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
BedrockMission!

Learn More

View all

Sign in to view all badges

Personalization block in Email subject

Avatar

Avatar
Validate 1
Level 2
supratim320
Level 2

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
supratim320
Level 2

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
supratim320
Level 2

16-01-2018

Hi All,

For my segmentation purpose, I am using a personalization block in my email delivery's subject line. Inside this personalization block, I am doing a soap call to fetch the subject appropriate for my segment. However, if after evaluation, if I get 'Hi <%= recipient.firstName %>' this recipient firstName part is not getting evaluated, rather i am getting the subject as 'Hi <%= recipient.firstName %>' not as 'Hi Jessie' (considering 'Jessie' is the recipient's first name).

Anyone has ever tried something like this? Any idea what I am doing wrong here?

Appreciate your response.

Thanks & regards

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
Alexandros2
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Alexandros2
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Alexandros2
Level 2

26-07-2018

In case it is of any interest to anyone, I was looking for a solution to this.

There is a function called evaluateTemplate() that would have worked for this, but it is not available in the delivery context, but only in a javascript workflow action.

So I manually searched and replaced the string that comes with personalization vars, similar to the following:

(This assumes that instead of <%= and %> the string comes with %JS_START% and %JS_END%. The reason I do this is that I want to _paste_ this code into a string, and having %> in a string will escape away from the _whole_ script)

<%

var dynamicSL = "%JS_START% recipient.firstName %JS_END%, today is %JS_START% formatDate(new Date(), '%Al')%JS_END%.";

var myRegEx = /%JS_START%.+?%JS_END%/g;

var evalPersonalization = function (str) {

   return eval(str.substr(10, str.length-18));

};

var finalSubjectLine = dynamicSL.replace(myRegEx, evalPersonalization);

%>

<%= finalSubjectLine %>

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
Level 2
supratim320
Level 2

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
supratim320
Level 2

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
supratim320
Level 2

28-07-2018

Yes, that's the only way I could find

Avatar

Avatar
Validate 1
Level 2
Alexandros2
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Alexandros2
Level 2

Likes

3 likes

Total Posts

9 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Alexandros2
Level 2

24-07-2018

supratim320​ Did you ever manage to find a solution for this issue? I'm facing the same problem. I'm pretty sure that eval'ing the string 'Hi <%= recipient.firstName %>'  won't work, so I'm looking into building a search-and-replace kind of solution where I check for probably just '<%='.

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

236 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

236 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

02-02-2018

Hi,

I'm not 100% sure that personalization blocks can be inserted in subject lines, but you can still use variables as Marjorie explained, as well as conditionality (Conditional content). Would that be enough as a workaround?

Florent

Avatar

Avatar
Validate 1
Level 2
supratim320
Level 2

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
supratim320
Level 2

Likes

2 likes

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
supratim320
Level 2

16-01-2018

Hi,

As stated, I am using a personalization block within the 'Subject' line, so I cannot mention subject module as you've mentioned. In my personalization block, I am driving various logic and deciding on final o/p and I am evaluating the subject. At the o/p of my personalization block, I am getting output = 'Hi <%= recipient.firstName %>' and then I am using <%=subject %>, I am not getting 'Hi Jessie', instead I am getting 'Hi <%= recipient.firstName %>' - in a nutshell, using personalization block, it is not evaluating the tags

Avatar

Avatar
Validate 1
Level 2
Marjorie59270
Level 2

Likes

8 likes

Total Posts

33 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Marjorie59270
Level 2

Likes

8 likes

Total Posts

33 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Marjorie59270
Level 2

16-01-2018

Bonjour !

Cela fonctionne pour moi, j'ai une diffusion récurrente avec comme objet :

1396050_pastedImage_0.png

Avez-vous bien été chercher la variable en cliquant sur objet puis sur 1396051_pastedImage_1.png ?

Bonne journée,

Cordialement,

Marjorie