AJO personalisation inside content from Custom Action API | Adobe Experience League Community
Skip to main content
mohit_khare
Level 3
August 24, 2026
Question

AJO personalisation inside content from Custom Action API

  • August 24, 2026
  • 7 replies
  • 22 views

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

7 replies

SatheeskannaK
Community Advisor
Community Advisor
August 24, 2026

@mohit_khare Take a look at this documentation page that explains how to use custom action responses for contextual personalization, in addition to including profile personalization.

https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalization/iterate-contextual-data#custom-action-responses

Thanks, Sathees
mohit_khare
Level 3
August 25, 2026

Hi ​@SatheeskannaK,

Yes i am aware of this personalisation and how to bring the data using the each and if condition. 

Infect we are using the same loop to get the data from the custom action. Something like this: 

{{#each context.journey.actions.12345-12345-12345.data.offerBundle.emailOffers as |emailOffers|}}  
{%#if @index = 0%}{{emailOffers.bodyCopy.html}}{%/if%}{{/each}}

but the thing is is the body or the HTML has personalisation like: 

{{profile.person.name.firstName}}, Your first gift showed us you care. Imagine what we could do together if your support continued every month. Monthly donors like you fund our core programmes year-round.

and instead of populating the name or any other profile based personalised field it just prints the whole field like:

{{profile.person.name.firstName}}, Your first gift showed us you care. Imagine what we could do together if your support continued every month. Monthly donors like you fund our core programmes year-round. Give a gift to your child, {{profile.child.name.childFirstName}}

is there a way to show the actual values when the profile personalisation path is being passed in the API JSON like mentioned above.

 

Thanks in Advance,

Mohit

SatheeskannaK
Community Advisor
Community Advisor
August 25, 2026

@mohit_khare Got it. Can you try along these lines,

{{#each context.journey.actions.12345-12345-12345.data.offerBundle.emailOffers as |offer|}}
{{#if @index == 0}}
<p>
{{profile.person.name.firstName}}, Your first gift showed us you care.
Imagine what we could do together if your support continued every month.
{{offer.campaignHeadline}}
Give a gift to your child, {{profile.child.name.childFirstName}}.
</p>
{{/if}}
{{/each}}

 

Thanks, Sathees
mohit_khare
Level 3
August 25, 2026

this works because in this one we are hardcoding the profile personalisation and the content into the email body.

But the issue is the the field {{emailOffers.bodyCopy.html}} has dynamic content to be brought which ahs personalisation and it does not get evaluated while the email gets sent out.

SatheeskannaK
Community Advisor
Community Advisor
August 25, 2026

It won’t work if you pass it through {{emailOffers.bodyCopy.html}}.

During the evaluation of {{emailOffers.bodyCopy.html}}, AJO fetches the values directly from the custom action response and outputs it verbatim. It does not conduct a second evaluation to parse any nested {{profile...}} expressions.

Thanks, Sathees
mohit_khare
Level 3
August 25, 2026

Yes, thats what i have researched so far. Is there a way where we can force evaluate the content like eval({{emailOffers.bodyCopy.html}}) like we have in other tools or in HTML.