AJO personalisation inside content from Custom Action API
Hi Team,
We have a AJO journey where we are fetching some data like TEXT and HTML using a API call in a custom action and then using the variable fields like: {{{offerEmail.body.text}}} and {{{offerEmail.body.html}}} to populate the details in the HTML email.
Its working fine if i use {{{offerEmail.body.html}}} but breaks if i use {{{offerEmail.body.text}}} like:
Hi Customer/n/nHere is your test email/n/nClick Here.
Hence i used HTML as its populates the partagraphs and the email looks good.
Now the issue is that the API contains few API specific personalisations as well like: {{profile.person.name.firstName}}, {{profile.person.name.lastName}} and many more and while populating the content inside of the email body in AJO it does not open up to show the respective value but just shows the personalisation fields including the handle bar like:
Hi {{profile.person.name.firstName}}
Here is your test email
Click Here.
Is there a way to get the values populate the values from the profile instead of the personalisation fields being showing as hardcoded.
PS: I tried replaceAll() and that works like: {%= replaceAll({{{offerEmail.body.html}}},“{{profile.person.name.firstName}}”,{{profile.person.name.firstName}})%} but there are lots of personalisation fields to be used and it will not make sense to have all the fields used in replace function.Also it breaks the HTML and the content is shown like this: <p>Hi Name from profile</p><p>Here is your test email</p><p>Click Here.</p>
Any helps would be appreciated here.
Thanks in Advance