Skip to content

Commit 03807ce

Browse files
Merge branch 'antimatter96-patch-1'
2 parents 959d13a + 5b37b46 commit 03807ce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

SendGrid/Example/Example.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ private static async Task HelloEmail()
3333
Email email = new Email("[email protected]");
3434
mail.Personalization[0].AddTo(email);
3535

36+
// If you want to use a transactional [template](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html),
37+
// the following code will replace the above subject and content. The sample code assumes you have defined
38+
// substitution variables [KEY_1] and [KEY_2], to be replaced by VALUE_1 and VALUE_2 respectively, in your template.
39+
//mail.TemplateId = "TEMPLATE_ID";
40+
//mail.Personalization[0].AddSubstitution("[KEY_1]", "VALUE_1");
41+
//mail.Personalization[0].AddSubstitution("[KEY_2]", "VALUE_2");
42+
3643
dynamic response = await sg.client.mail.send.post(requestBody: mail.Get());
3744
Console.WriteLine(response.StatusCode);
3845
Console.WriteLine(response.Body.ReadAsStringAsync().Result);

0 commit comments

Comments
 (0)