Reputation: 3270
Maybe I'm not seeing the obvious here. I'm using this library for sending mails. And I'm also using transactional templates.
A quick code example:
var msg = new SendGridMessage {From = new EmailAddress("[email protected]")};
var personlization = new Personalization {Tos = new List<EmailAddress> {new EmailAddress("[email protected]")}};
dynamic t = new System.Dynamic.ExpandoObject();
t.firstname = "John";
t.lastname = "Doe";
t.message = "a <br/> line <br/> break";
msg.TemplateId = "abcdefg";
personlization.TemplateData = t;
msg.Personalizations = new List<Personalization> {personlization};
var response = await client.SendEmail(msg);
I can see how to add content manually, text or html by using the htmlContent
prop, but in this case I'm using a transactional template.
In the example above, the email comes through html encoded instead of creating the line breaks, and I want the personalizations to be html. In addition, the template is html.
Upvotes: 6
Views: 6734