Send email with Readable JSON with Html in body


Currently I’m trying to send out and email which reads in an external json file.
The problem I’m having is when I want to send the email with “IsBodyHtml” being checked,
I lose all the nice formatting from the json file.

To inject the json, I read a text file, deserialize the json text file string into a jObject, Then I assign a string to = JsonConvert.SerializeObject(jObject, Newtonsoft.Json.Formatting.Indented)
To format the json again. This puts it in a nice format when i send without using HTMl in the body of the email.

So any help on how to format this with using html in the body of the email would be great.

Hi @michael.p.wilson , check this link below :

Hope it help you.

Let me know

~Diego Turati


Thanks Deigo. I found this shortly after I posted. Works great. Now the new email what I want the email to look like in html is like this where place holder {3} is the "pre’ tag with the json string.
What happens is instead of the place holders being side by side with the screen shots on the right it instead puts the screen shots just below. So I still want to keep this format but it seems to put it below one another

1 Like

Great news @michael.p.wilson! It’s not exactlyyy how you want to see. But you were able to place json inside HMTL.
Problem solved :sunglasses:

~Diego Turati

I converted all to use a table in the html template.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.