onix-systems-php / hyperf-mailer
An extension to send email
Installs: 3 431
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:extention
Requires
- php: >=8.1
- ext-json: *
- ext-swoole: >=4.5
- aws/aws-sdk-php: ^3.297
- hyperf/async-queue: ^3.1
- hyperf/command: ^3.1
- hyperf/config: ^3.1
- hyperf/devtool: ^3.1
- hyperf/di: ^3.1
- hyperf/event: ^3.1
- hyperf/filesystem: ^3.1
- hyperf/logger: ^3.1
- hyperf/translation: ^3.1
- hyperf/view: ^3.1
- league/flysystem: ^2.0|^3.0
- onix-systems-php/hyperf-core: >=1.2.0
- symfony/http-client: ^7.0
- symfony/mailer: ^6.0
- tijsverkoyen/css-to-inline-styles: ^2.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.5
- swoole/ide-helper: ^4.5|^5.0
Suggests
- symfony/amazon-mailer: Amazon SES transport.
- symfony/infobip-mailer: Infobip transport.
- symfony/mailchimp-mailer: MailChimp Mandrill transport.
- symfony/mailgun-mailer: Mailgun transport.
- symfony/mailjet-mailer: Mailjet transport.
- symfony/mailpace-mailer: MailPace transport.
- symfony/postmark-mailer: Postmark transport.
- symfony/sendgrid-mailer: SendGrid transport.
- symfony/sendinblue-mailer: Sendinblue transport.
README
Provides hyperf wrapper for the symfony/mailer package.
You can use features like High Availability and Load Balancing.
Includes the following classes:
- Command:
- GenMailCommand;
- Contract:
- HasLocalePreference;
- HasMailAddress;
- ShouldQueue;
- Event:
- MailMessageSending;
- MailMessageSent.
- Service:
- EmailService.
- Mail;
- Mailable.
Install:
composer require onix-systems-php/hyperf-mailer
Publish config:
php bin/hyperf.php vendor:publish onix-systems-php/hyperf-mailer
Code Example:
<?php declare(strict_types=1); namespace App\Mail\Users; use OnixSystemsPHP\HyperfMailer\Contract\ShouldQueue; use OnixSystemsPHP\HyperfMailer\Mailable; class TestEmail extends Mailable implements ShouldQueue { public function __construct(private string $name) { } public function build(): void { $this ->subject('PHP Department welcome') ->textBody(sprintf('Hello, %s!', $this->name)); } } ... $this->emailService->run( new User([ 'email' => $recipient[0], 'first_name' => $recipient[1], ]), new TestEmail($recipient[1]) );
Based on https://github.com/hyperf-ext/mail