Download the PHP package marketforce-info/yii2-sendgrid without Composer
On this page you can find all versions of the php package marketforce-info/yii2-sendgrid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marketforce-info/yii2-sendgrid
More information about marketforce-info/yii2-sendgrid
Files in marketforce-info/yii2-sendgrid
Package yii2-sendgrid
Short Description Yii2 Sendgrid Mailer extension
License MIT
Homepage https://github.com/marketforce-info/yii2-sendgrid
Informations about the package yii2-sendgrid
MarketforceInfo/Yii2-SendGrid
Description
Yii2 Mailer extension for SendGrid with batch mailing support.
Recommended alternative
A possible alternative to this component is the following combination
Installation
Then configure your mailer
component in your main-local.php
(advanced) or web.php
(basic) like so:
Do not forget to replace apiKey
with your SendGrid API key. It must have permissions to send emails.
Usage
Basic
Single Mailing
Batch Mailing
If you want to send to multiple recipients, you need to use the below method to batch send.
NOTE: SendGrid supports a max of 1,000 recipients. This is a total of the to, bcc, and cc addresses. I recommend using 500
for the batch size. This should be large enough to process thousands of emails efficiently without risking getting errors by accidentally breaking the 1,000 recipients rule. If you are not using any bcc or cc addresses, you could raise the batch number a little higher. Theoretically, you should be able to do 1,000 but I would probably max at 950 to leave some wiggle room.
Known Issues
addSection()
- There is currently an issue with the SendGrid API where sections are not working.setSendAt()
- There is currently an issue with the SendGrid API where usingsend_at
where the time shows the queued time not the actual time that the email was sent.setReplyTo()
- There is currently an issue with the SendGrid PHP API where the ReplyTo address only accepts the email address as a string. So you can't set a name.
Todo
There are a few things left that I didn't get to:
- ASM
- mail_settings
- tracking_settings
Contributions gratefully accepted in the form issues or PRs.
Attribution
This extension was originally created by https://www.github.com/wadeshuler
All versions of yii2-sendgrid with dependencies
ext-json Version *
sendgrid/sendgrid Version ^7.0
yiisoft/yii2 Version ^2