Download the PHP package wedevelop4you/laravel-multiple-mailers without Composer
On this page you can find all versions of the php package wedevelop4you/laravel-multiple-mailers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wedevelop4you/laravel-multiple-mailers
More information about wedevelop4you/laravel-multiple-mailers
Files in wedevelop4you/laravel-multiple-mailers
Package laravel-multiple-mailers
Short Description Adds multiple mailers
License MIT
Informations about the package laravel-multiple-mailers
Laravel Multiple Mailers
I made this package because I wanted to use multiple mails. It is a small simple package to use multiple mails in Laravel. I'm not really going to expand it any further. Only if I want to add functions myself. You are free to use the package and here is a little explanation of how to use it.
Installation
PHP 7.0 or higher and Laravel 7 or higher are required.
Require this package with composer.
Publish the config file by running:
Config
config the mailers in: multiple-mailer
Accounts config:
| name | type | required | default |
|---|---|---|---|
| name mail config | object | true | null |
| username | string | true | null |
| password | string | true | null |
| name | string | false | MAIL_FROM_NAME in your .env file |
| produces | string | false | default |
Providers config:
Queue config:
If you want to queue all the mail on the same worker name but except one or more, Than you can set onQueue in your mail class. The code will not override the queue name.
How to use it
When sending an email you need to set the mailer. The mailer name is the name you set in the mailer config.
Example:
Now import MultipleMailer in your mail class.
Finally set the mailer name in your mail class in the __construct or in your own function. You need to give it the same name as above
Examples:
Exceptions
MailerAccountNotFoundException
throws when the mailer name doesn't exist in the config file.
MailerProviderNotFoundException
throws when the provider name doesn't exist in the config file.