Download the PHP package vulcandigital/silverstripe-sendgrid without Composer
On this page you can find all versions of the php package vulcandigital/silverstripe-sendgrid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vulcandigital/silverstripe-sendgrid
More information about vulcandigital/silverstripe-sendgrid
Files in vulcandigital/silverstripe-sendgrid
Package silverstripe-sendgrid
Short Description A module to assist developers in sending template emails via SendGrid
License BSD-3-Clause
Informations about the package silverstripe-sendgrid
silverstripe-sendgrid
A module to assist developers in sending template emails via SendGrid
Requirements
- silverstripe/framework: ^4.0
Installation
Configuration
mysite/_config/sendgrid.yml:
Usage
You can add as many recipients as you want.
Substitutions & Custom Arguments
Substitutions and custom arguments are practically the same thing, the only difference is that custom arguments are applied globally regardless of the recipient where substitutions are variable replacements that can differ per recipient.
Substitutions will always override any custom argument
Substitutions
Substitutions are variables that can be replaced per recipient
Custom Arguments
Custom arguments are applied globally across all recipients unless a substitution has overridden it
Attachments
You can add as many attachments as you want totalling up to 30 MB. The attachment must be a File
object or a subclass of it such as itself or Image
.
or you can use an absolute path to a file instead:
If you provide $filename
, make sure you provide the correct extension as well to prevent any errors
If the provided file is a File
object and $forcePublish
is set to true
and the File
you have provided has not been published, it will be forcibly published.
Scheduling
You can schedule emails to be sent at a later date:
Important: Ensure that you have specified your correct timezone in your SendGrid account's settings, otherwise this may have unexpected results.
Your database timezone should also match the timezone you have specified in your account. See Core Environment Variables for information on how to modify the timezone used by your database.
It is always advised when dealing with dates and times in SilverStripe to use the functionality it has provided you as shown in the example above.
Sandbox Mode
If everything is OK, $sendGrid->send() will return true otherwise an error will be thrown.
License
Vulcan Digital Ltd