Class SendGridPersonalization

SendGrid personalization

class SendGridPersonalization;
auto personalization = new SendGridPersonalization("john@example.com", "John Doe");
personalization.subject("Hello World");
personalization.addDynamicTemplateData("name", "John Doe");

Constructors

NameDescription
this (toEmail, toName) Constructor. At least one recipient is required

Methods

NameDescription
addBCC (email, name) Add a BCC recipient
addCC (email, name) Add a CC recipient
addDynamicTemplateData (key, value) Add a value for a dynamic template (see SendGrid.templateId)
addSubstitution (key, value) Add a substitution (legacy templates): every key in the message is replaced with value
addTo (email, name) Add a recipient
dynamicTemplateData (value) Set all the data for a dynamic template at once. It must be a JSON object.
sendAt (time) Set the time at which the message should be sent
subject (subject) Set the subject of the message