Logic App
"Send_an_email_(V2)": {
"inputs": {
"body": {
"Body": "<p><br></p>\n<pre><code>Message 1<br>\n<br>\n@{variables('Message1')}<br>\n<br>\nMessage 2<br>\n<br>\n@{variables('Message2')}</code></pre>\n<pre><code><br>\n<br>\n<br>\n<br>\n</code></pre>",
"Importance": "Normal",
"Subject": "Test",
"To": "[email protected]"
}
This is how it looks like in the email. I know the Message 2 has it already nicely formatted but I would want both to look the same.
Any ideas are appreciated.
CodePudding user response:
After reproducing issue from my side, I got the expected results by taking Parse Json Action after initialize variable action.
As shown in below images i have taken initialize variable actions and send email.
With out parse Json action I got below output in email.
As shown in below image in Parse Json action take Content as Message 1 from dynamic content .
Schema :
{
"Request_Date": "2023-07-18",
"Number_of_Adults": "5",
"Number_of_Children": "1",
"Total_Cost": "690"
}
Then in Send Email action in body take your required data from dynamic content of parse Json 1 as shown in below image.
Then the logic App ran successfully and email got received with expected output format.
replace(replace(replace(variables('Message1'),',',',<br> '),'{','{<br> '),'}','<br>}')