yii-extension / mailer-service
Yii3 Mailer Services
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 236
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 4
Requires
- php: ^7.4|8.0
- yiisoft/aliases: ^1.1
- yiisoft/mailer: ^3.0@dev
- yiisoft/mailer-swiftmailer: ^3.0@dev
- yiisoft/yii-event: ^3.0@dev
Requires (Dev)
- nyholm/psr7: ^1.3.0
- phpunit/phpunit: ^9.5
- roave/infection-static-analysis-plugin: ^1.6
- vimeo/psalm: ^4.3
- yiisoft/composer-config-plugin: ^1.0@dev
- yiisoft/di: ^3.0@dev
- yiisoft/log: ^3.0@dev
This package is auto-updated.
Last update: 2024-01-06 13:11:34 UTC
README
Mailer services
Requirements
The minimum requirement by this project template that your Web server supports PHP 7.4.0.
Installation
composer require yii-extension/mailer-service
Usages:
You can inject mailer-service into the controller or action, and automatically all dependencies are resolved by autowired in di-container.
public function contact( MailerService $mailer, ServerRequestInterface $request, ): ResponseInterface { $mailer->run( 'test@example.com', // from 'admin1@example.com', // to 'TestMe', // subject '@mail', // path mail [ 'html' => 'contact'], // name layout [ // params 'username' => 'User', 'body' => 'TestMe', ], $request->getUploadedFiles(), // attach files ); }
Unit testing
The package is tested with PHPUnit. To run tests:
./vendor/bin/phpunit
Mutation testing
The package tests are checked with roave-infection-static-analysis-plugin mutation framework. To run it:
./vendor/bin/roave-infection-static-analysis-plugin
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalm