globegroup / emaillabs-mailer
Emaillabs.pl mailer using symfony/mailer transport abstraction.
Installs: 2 752
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.2.5
- symfony/mailer: ^4.4|^5.0
Requires (Dev)
- symfony/http-client: ^4.4|^5.0
This package is auto-updated.
Last update: 2024-10-28 23:11:09 UTC
README
Features included:
- Configuration based on Symfony DSN in
.env
files - Sending emails with EmailLabs REST API
- All benefits from symfony/mailer
Installation
-
symfony/mailer is required in version 4.4.*
-
Execute command:
composer require globegroup/emaillabs-mailer
-
Add service declaration in services.yaml:
GlobeGroup\EmailLabsMailer\Transport\EmailLabsTransportFactory: tags: - { name: mailer.transport_factory }
-
In
.env.local
use the configuration listed below:###>Â symfony/mailer ### EMAILLABS_APP_KEY=<YOUR_APP_KEY> EMAILLABS_SECRET=<YOUR_SECRET> EMAILLABS_SMTP_ACCOUNT=<YOUR_SMTP_ACCOUNT> MAILER_DSN=emaillabs+api://$EMAILLABS_APP_KEY:$EMAILLABS_SECRET@default?smtpAccount=$EMAILLABS_SMTP_ACCOUNT ###< symfony/mailer ###
LOCAL TESTING
- Clone repository into
symfony/localVendor
folder. - Add into composer.json:
"repositories": [ { "type": "path", "url": "localVendor/globegroup-emaillabs-mailer" } ],
- Check if
minimum-stability
is set todev
. - Proceed to Installation.
EmailLabs specific functions
-
Tags
Add
X-MailTags
header when creating new email message and separate tags by;
as in example code:$email = new Email(); $email->getHeaders()->addTextHeader('X-MailTags', 'tag_1;tag_2');
License
This bundle is under the MIT license. See the complete LICENSE
TODO
- Verify string length? For example subject in EmailLabs is max 128 chars.
- Add recipe which automatically add service declaration.
- Add recipe which automatically add .env custom configuration example.