q-alliance / qsendgridbundle
There is no license information available for the latest version (1.0.4) of this package.
Symfony bundle implementation of QSendgrid mailer service
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Package info
github.com/Q-Alliance/QSendGridBundle
Type:symfony-bundle
pkg:composer/q-alliance/qsendgridbundle
1.0.4
2020-07-25 11:41 UTC
Requires
- q-alliance/qsendgrid: ^1.0
This package is not auto-updated.
Last update: 2021-10-02 17:32:38 UTC
README
Symfony bundle implementation of QSendgrid mailer service.
Prerequisites
You will need to provide:
- Sendgrid API key, which can be created in Sendgrid user interface
- No Reply email address
Key example: SG.QDzWlz_gShWMVi8svP...
Installing
Install QSendgridBundle with composer:
composer require q-alliance/qsendgridbundle
Setup
Update AppKernel.php
$bundles = [
...
new QAlliance\QSendgridBundle\QAllianceQSendgridBundle(),
];
Update config.yml
# QSendgrid Configuration
q_alliance_q_sendgrid:
no_reply_email: NO_REPLY_EMAIL
sendgrid_api_key: SENDGRID_API_KEY
Basic usage
Get QSendgrid mailer service from controller and send simple email:
$qs = $this->get('qalliance.qsendgrid'); $result = $qs->send('to@example.com', 'My Subject', '<h1>This is a QSendgrid test email.</h1>');
Sending html email with attachments:
$attachmentUrls = [ './assets/attachments/sample1.jpg', './assets/attachments/sample2.jpg' ]; $qs = $this->get('qalliance.qsendgrid'); $result = $qs->send('to@example.com', 'My Subject', '<h1>This is a QSendgrid test email with attachments.</h1>', $attachmentUrls);
Add fromName as last parameter (optional):
$qs = $this->get('qalliance.qsendgrid'); $result = $qs->send('to@example.com', 'My Subject', '<h1>This is a QSendgrid test email.</h1>', null, 'From Name');
Sending email with html and plain text content:
$qs = $this->get('qalliance.qsendgrid'); $result = $qs->sendWithTextPlain('to@example.com', 'My Subject', '<h1>This is a QSendgrid test email with plain text.</h1>', 'This is a QSendgrid test email with plain text', null, 'From Name');
Authors
- Vicko Franic - Github