It is working without any issue, if I am testing the Data Action directly and pasting the HTML body of any email into the GUI.
But what I am aiming to do is to fill this attribute in the Architect, using the Email.Message.htmlBody like that
But if I do it like that, then the Data Action in the Architect always fails.
I even tried to save the variable Email.Message.htmlBody into the Participant Data and then copy the exact same text directly into the Architect like that:
Does anyone know, if the variable Email.Message.htmlBody itself has some kind of strange formating when used as an input into the Data Action or what should I do, to be able to use it correctly?
But as I mentioned, if you place it directly into the Architect as a literal, then it is working fine. The problem is just when I am using directly the Email.Message.htmlBody variable.
And also it doesn't seem to matter, what is in the email. The situation is always the same. I tried to send simple email, with just one word and also more complicated emails with styling, etc. and it is still the same - using variable is not working, placing HTML directly working fine.
Sorry for the huge delay. I tried this out and don't have any answers for what is going wrong. I am pinging a different team to see if they have any ideas. Right now I would suggest that you open a support ticket so you can gather logs from architect and see exactly what is being sent to the data action that is failing. Often that will make the problem clear.
After some help from a coworker I think that the issue you are facing is that the html string has newlines in it, which is resulting in the request template being invalid JSON. When you paste it into the data action test mode box or hard code the value in architect those newlines appear to be treated differently than when the variable is directly used.
I came up with a couple of approaches that seem to work:
Have the requestTemplate remove any newlines (\n or \r) from the string: