Issue Summary
I'm currently using the workaround for sending template data to the API and it seems to be working fine. The only thing I can't figure out is how I can send an HTML fragment as a substitution.
Steps to Reproduce
So, I am using this as part of my email service:
var obj = (JObject)JsonConvert.DeserializeObject(messageJSON);
var personalizations = (JArray)obj["personalizations"];
foreach (var personalization in personalizations.Cast())
{
var substitutions = personalization.Property("substitutions");
substitutions.Replace(new JProperty("dynamic_template_data", substitutions.Value));
}
var dynamicMessage = obj.ToString();
await client.RequestAsync(SendGridClient.Method.POST, dynamicMessage, null, "mail/send");
Before that I set the substitutions which will be converted to the dynamic_template_data.
If I use something like:
msg.AddSubstitution("Content","This is a test
test");
The {{Content}} placeholder in my template is rendered with the
visible in the test string.
How can I get the template to replace the placeholder with my html content and render it as html?
(Like what the Html.Raw() method does in razor)
Thanks,
Jason