Skip to content

Commit

Permalink
Merge pull request #1 from thinkingserious/patch-2
Browse files Browse the repository at this point in the history
Adjusting content and commenting out the optional template functionality
  • Loading branch information
antimatter96 committed Jul 23, 2016
2 parents a56b187 + 713b3c4 commit 666b169
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions SendGrid/Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ private static void HelloEmail()
Email email = new Email("test2@example.com");
mail.Personalization[0].AddTo(email);

//If you want to use a tempalte
//Adding this will replace the above added subject and content
mail.TemplateId = "TEMPLATE_ID";
mail.Personalization[0].AddSubstitution("[KEY_1]", "VALUE_1");
mail.Personalization[0].AddSubstitution("[KEY_2]", "VALUE_1");
// If you want to use a transactional [template](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html),
// the following code will replace the above subject and content. The sample code assumes you have defined
// substitution variables [KEY_1] and [KEY_2], to be replaced by VALUE_1 and VALUE_2 respectively, in your template.
//mail.TemplateId = "TEMPLATE_ID";
//mail.Personalization[0].AddSubstitution("[KEY_1]", "VALUE_1");
//mail.Personalization[0].AddSubstitution("[KEY_2]", "VALUE_2");

dynamic response = sg.client.mail.send.post(requestBody: mail.Get());
Console.WriteLine(response.StatusCode);
Expand Down

0 comments on commit 666b169

Please sign in to comment.