Download the PHP package agrandesr/php-mailer-action without Composer
On this page you can find all versions of the php package agrandesr/php-mailer-action. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download agrandesr/php-mailer-action
More information about agrandesr/php-mailer-action
Files in agrandesr/php-mailer-action
Package php-mailer-action
Short Description This Custom Actions is a implementation of the PHPMailerpackage over Agile Router to send emails in a very easy way using the Custom Actions of Agile Router.
License MIT
Informations about the package php-mailer-action
PHPMailerAction
This package is an extension of Agrandesr/agile-router (v1.0+).
This Custom Actions is a implementation of the PHPMailer package over Agile Router to send emails in a very easy way using the Custom Actions of Agile Router.
Installation
First we need to require the package:
Next, we need to add to the Router before the run method.
Next you have to modify .env file with your mail server data:
Now you can use the new action in your routes file.
And that is all, you can create a endpoint to send a email very easy.
Content parameters
Like you can see in the example, the action "PhpMailer" have the next parameters:
- addAddress['required']:
- addCC['optional']:
- addBCC['optional']:
- addAttachment['optional']:
- body['optional']: You can add a source direction like "src/template.html" or write directly the html code.
- altBody['optional']:
- envFlag: You can add a flag to change the env variable key name to allow more than one mail server.
ENV variables
You can have more than one mail server setted for one project using envFlag. The envFlag adds the value of the endFlag in the middle of your envFlag key. For example:
For the last example you have to complete other env variables: