Vulcan\SendGrid\SendGrid
Class SendGrid
- Author: Reece Alexander <reece@vulcandigital.co.nz>
Synopsis
class SendGrid
{
- // members
- private static bool $api_key = false;
- protected SendGrid $sendGrid;
- protected ArrayList $to;
- protected $subject;
- protected $from;
- protected null|string $fromName = NULL;
- protected $replyTo;
- protected $templateId;
- protected $body;
- protected ArrayList $attachments;
- protected $sendAt;
- protected bool $sandbox = false;
- protected ArrayList $customArgs;
- // methods
- public void __construct()
- public void send()
- public $this addAttachment()
- private $this addFileAsAttachment()
- public void validate()
- public ArrayList getRecipients()
- public $this addRecipient()
- public string getTemplateId()
- public $this setTemplateId()
- public $this setScheduleTo()
- public int getSchedule()
- public string getSubject()
- public $this setSubject()
- public string getFromName()
- public $this setFromName()
- public string getFrom()
- public $this setFrom()
- public string getBody()
- public $this setBody()
- public string getReplyTo()
- public $this setReplyTo()
- public string getApiKey()
- public ArrayList getErrorMap()
- public ArrayData getErrorDefinition()
- public ArrayList getAttachments()
- public bool isSandbox()
- public $this setSandboxMode()
- public ArrayList getCustomArgs()
- public $this addCustomArg()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Members
private
- $api_key — Vulcan\SendGrid\bool
protected
- $attachments — SilverStripe\ORM\ArrayList
- $body — string
- $customArgs — SilverStripe\ORM\ArrayList
- $from — string
- $fromName — Vulcan\SendGrid\null|string
- $replyTo — string
- $sandbox — Vulcan\SendGrid\bool
- $sendAt — int
- $sendGrid — \SendGrid
- $subject — string
- $templateId — string
- $to — SilverStripe\ORM\ArrayList
Methods
private
- addFileAsAttachment() — Handles adding {@link File} objects as attachments
public
- __construct() — SendGrid constructor.
- addAttachment() — Handles adding file attachments to the email
- addCustomArg() — Add a global substitution that applies to all recipients unless overridden with personalization
- addRecipient() — Add a recipient
- getApiKey()
- getAttachments()
- getBody()
- getCustomArgs() — Return the customArgs {@link ArrayList}
- getErrorDefinition()
- getErrorMap()
- getFrom()
- getFromName()
- getRecipients() — Get the recipient list
- getReplyTo()
- getSchedule()
- getSubject()
- getTemplateId()
- isSandbox()
- send() — Send the email
- setBody()
- setFrom()
- setFromName()
- setReplyTo()
- setSandboxMode()
- setScheduleTo() — Delay sending of the email until the specified time. It is important that you have specified your correct timezone in your SendGrid account's settings, otherwise this may have unexpected results.
- setSubject()
- setTemplateId()
- validate() — Validate that the object is ready to send an email