terabytesoftw / helper-mailer
Component Mailer User Core
Installs: 137
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: ^7.2.0
- oomphinc/composer-installers-extender: ^1.1
- yiisoft/yii2: ^2.0.20
- yiisoft/yii2-swiftmailer: ^2.1.2
Requires (Dev)
- codeception/c3: 2.*
- codeception/codeception: ^3.0
- dms/phpunit-arraysubset-asserts: ^0.1.0
- hiqdev/composer-config-plugin: ^0.3.0
- monolog/monolog: *
- yiisoft/yii2-debug: ~2.1.0
- yiisoft/yii2-faker: ~2.0.0
- yiisoft/yii2-gii: ~2.1.0
This package is auto-updated.
Last update: 2024-11-29 06:21:48 UTC
README
Helper Mailer.
DIRECTORY STRUCTURE:
config/ contains application configurations
src/ contains source files
tests/ contains tests codeception for the web application
vendor/ contains dependent 3rd-party packages
REQUIREMENTS:
- The minimum requirement by this project template that your Web server supports:
- PHP 7.2 or higher.
- Composer Config Plugin
INSTALLATION:
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this extension using the following command composer:
composer require terabytesoftw/helper-mailer '^1.0@dev'
or add composer.json:
"terabytesoftw/helper-mailer":"^1.0@dev"
USAGE:
// config params defaults config/maileruser.php
// note: if you change one of the default values you must execute: composer du, from the command line.
// config default
'helper.mailer.usefiletransport' => true,
'helper.mailer.sender' => 'no-reply@helpermailer.com', // from->email
'helper.mailer.sender.name' => 'helper mailer example', // from->name
'helper.mailer.swiftmailer.logging' => false,
'helper.mailer.viewpath' => '@root/tests/_data/views', // viewPath
// Simple email:
<?php
use terabytesoft\helpers\Mailer;
$mailer = new Mailer();
$this->mailer->sendMessage(
'test@helpermailer.com', // to->email
'test mailer user codecept', // subject->email
// options->email
[
'replyTo' => 'replyto@helpermailer.com', // replyTo->email
'textBody' => 'Plain text content' // bodyContent->email
],
);
// Email with views params:
<?php
use terabytesoft\helpers\Mailer;
$mailer = new Mailer();
$this->mailer->sendMessage(
'test@helpermailer.com', // to->email
'test mailer user codecept', // subject->email
// options->email
[
'views' => 'viewtest', // views->email
],
// params->email
[
'params' => 'Params text content', // params->email
],
);
RUN TESTS CODECEPTION:
// download all composer dependencies root project
$ composer update --prefer-dist -vvv
// run all tests with code coverage
$ vendor/bin/codecept run --coverage-xml
WEB SERVER SUPPORT:
- Apache.
- Nginx.
- OpenLiteSpeed.