Sending email htmlBody via Data Action

Hello, I am trying to send the html body of email, which come to the Genesys via Data Action to our CRM.

In my Request Body Template, I am escaping the HTML characters using the $esc.html

"emailBody" : #if( ${input.emailBody} && ${input.emailBody} != "")"$esc.html(${input.emailBody})"#{else}null#end,

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

image

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:

And again, this is working perfectly.

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?

Thank you

Could you post the HTML as text so we can try to reproduce your issue?

--Jason

Hello Jason,

the HTML of the email, which I tried is following.


<div class="WordSection1">
<p>Ahoj</p>
<p> </p>
<p><b><span style="font-size:9pt;font-family:&#39;arial black&#39; , sans-serif;color:#5f5f5f">Jakub Zíta</span></b><span style="color:black"></span></p>
<p><span style="font-size:9pt;font-family:&#39;arial&#39; , sans-serif;color:#5f5f5f">Technical Consultant for Contact Centers
</span></p>
<p><span style="font-size:9pt;font-family:&#39;arial&#39; , sans-serif;color:#5f5f5f"> </span></p>
<p><span style="font-size:9pt;font-family:&#39;arial black&#39; , sans-serif;color:#c20000">ALCA</span><span style="font-size:9pt;font-family:&#39;arial black&#39; , sans-serif;color:#5f5f5f">SYS
 Czech Republic, s.r.o.</span><span style="font-size:9.5pt;color:black"> </span><span style="font-size:9.5pt;font-family:&#39;arial&#39; , sans-serif;color:#5f5f5f"><br />
</span><span style="font-size:9pt;font-family:&#39;arial&#39; , sans-serif;color:#767171">Antala Staška 511/40</span><span style="color:black"></span></p>
<p><span style="font-size:9pt;font-family:&#39;arial&#39; , sans-serif;color:#767171">140 00 Praha 4</span><span style="font-size:9.5pt;font-family:&#39;arial&#39; , sans-serif;color:#5f5f5f"><br />
<br />
</span><span style="font-size:9pt;font-family:&#39;arial&#39; , sans-serif;color:#767171">mobile:    &#43;420 736 210 875</span><span style="color:black"></span></p>
<p><span style="font-size:9.5pt;font-family:&#39;arial&#39; , sans-serif;color:#5f5f5f">e-mail:
</span><span style="font-size:11pt"><a href="mailto:jakub.zita&#64;alcasys.eu" rel="nofollow"><span style="font-size:9.5pt;font-family:&#39;arial&#39; , sans-serif;color:#0563c1">jakub.zita&#64;alcasys.eu</span></a></span><span style="font-size:9.5pt;font-family:&#39;arial&#39; , sans-serif;color:#5f5f5f">
</span><span style="font-size:11pt"></span></p>
<p> </p>
</div>

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.