Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vs-point/symfony-mailjet-mailer
Provides Mailjet integration for Symfony Mailer
https://github.com/vs-point/symfony-mailjet-mailer
email mailer mailjet php symfony symfony-component
Last synced: 15 days ago
JSON representation
Provides Mailjet integration for Symfony Mailer
- Host: GitHub
- URL: https://github.com/vs-point/symfony-mailjet-mailer
- Owner: vs-point
- Created: 2020-07-21T12:26:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-30T16:04:16.000Z (almost 4 years ago)
- Last Synced: 2024-10-17T15:49:11.010Z (about 1 month ago)
- Topics: email, mailer, mailjet, php, symfony, symfony-component
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Mailjet Mailer
==============Provides Mailjet integration for Symfony Mailer.
## Usage
1. Installation via composer
```bash
composer require vs-point/symfony-mailjet-mailer
```2. Register in services.yaml
```yaml
VSPoint\Mailjet\Transport\MailjetTransportFactory:
tags:
- mailer.transport_factory
```3. Provide configuration in .env file
```
{JETMAILER_NAME}=mailjet://{public key}:{private key}@api.mailjet.com
```### Send base email
```php
$dsn = 'mailjet://{public key}:{private key}@api.mailjet.com';$transport = Transport::fromDsn($dsn);
$mailer = new Mailer($transport);
$email = (new Email())
->from('[email protected]')
->to('[email protected]')
//->cc('[email protected]')
//->bcc('[email protected]')
//->replyTo('[email protected]')
//->priority(Email::PRIORITY_HIGH)
->subject('Time for Symfony Mailer!')
->text('Sending emails is fun again!')
->html('See Twig integration for better HTML integration!
');
$mailer->send($email);
```### Send templated email
```php
$dsn = 'mailjet://{public key}:{private key}@api.mailjet.com';$transport = Transport::fromDsn($dsn);
$mailer = new Mailer($transport);
$email = (new MailjetTemplateEmail(123456789,['variable'=>'value']))
->from('[email protected]');
$mailer->send($email);
```