Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Personalization field in script

filipe23353816
Level 2
Level 2

Hi,

I have a script in an email template which I want to populate with the name and email of the recipient. How may I do that? See the script below where I have tried to add the personalization field but I am not sure of the format. Now it will just be formatted as text.

<script type="application/json+trustpilot">
{
"recipientName": "<span class="acr-field nl-dce-field" data-nl-expr="/context/targetData/name" data-nl-type="string" contenteditable="false">Name (name)</span>",
"recipientEmail": "<span class="acr-field nl-dce-field" data-nl-expr="/context/targetData/email" data-nl-type="string" contenteditable="false">Email (email)</span>"
}
</script>

 

Br

Filip

1 Accepted Solution
jamal
Correct answer by
Level 2
Level 2

Hi Filip, 

 

The notation you used is generally just for email content, you may want to call the variables using this format instead:

Where firstname: <%= context.targetDate.name%> .

 

In the script that would be:

 

<script type="application/json+trustpilot">
{
"recipientName": "<%= context.targetDate.name%>",
"recipientEmail": "<%= context.targetDate.email%>"}
</script>

 

This is the way variables are called in Campaign Classic, and I've used it with success in Standard too. 

Please let me know how it goes.

 

Cheers,

Jamal

View solution in original post

0 Replies
jamal
Correct answer by
Level 2
Level 2

Hi Filip, 

 

The notation you used is generally just for email content, you may want to call the variables using this format instead:

Where firstname: <%= context.targetDate.name%> .

 

In the script that would be:

 

<script type="application/json+trustpilot">
{
"recipientName": "<%= context.targetDate.name%>",
"recipientEmail": "<%= context.targetDate.email%>"}
</script>

 

This is the way variables are called in Campaign Classic, and I've used it with success in Standard too. 

Please let me know how it goes.

 

Cheers,

Jamal

View solution in original post