-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,23 @@ $sendGrid->addRecipient('[email protected]', 'Reece Alexander', [ | |
]); | ||
$sendGrid->setBody("<p>We thought you'd like this awesome t-shirt!</p>"); | ||
$sendGrid->setTemplateId('your-template-id'); | ||
$sendGrid->addAttachment(Image::get()->first()); | ||
$sendGrid->send(); | ||
``` | ||
|
||
You can add as many recipients as you want. | ||
|
||
### Attachments | ||
You can add as many attachments you want totalling up to 30 MB. The attachment must be a `File` subclass such as itself or `Image`. | ||
|
||
```php | ||
$file = Image::get()->first(); | ||
$sendGrid->addAttachment($file, $filename = null, $forcePublish = false); | ||
``` | ||
|
||
If you provide `$filename`, make sure you provide the correct extension as well to prevent any errors | ||
|
||
If you provide `$forcePublish` if the `File` you have provided has not be published, it will be forcibly published | ||
|
||
## License | ||
[BSD-3-Clause](LICENSE.md) - [Vulcan Digital Ltd](https://vulcandigital.co.nz) |