Add conditional statement (dynamic content) in the subject line

Avatar

Avatar
Validate 1
Level 1
Sarim60660
Level 1

Likes

0 likes

Total Posts

22 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
Sarim60660
Level 1

Likes

0 likes

Total Posts

22 posts

Correct reply

1 solution
Top badges earned
Validate 1
Affirm 1
View profile
Sarim60660
Level 1

13-01-2021

Hello,

 

I am trying to use dynamic content in the subject line based on the values in "gender" field. Gender field can have 3 values:

 

Male

Female

Default

 

I was trying to use this but it's not working:

 

Hello <%if(context.profile.gender=='Male'){%>
Gentlemen<%} else if(context.profile.gender=='Female'){%>
Ladies<%}else{%>Everyone<%}%>, Season Sale ends today!

 

Any tips/ideas how to edit this?

 

Thanks!

 

AK

View Entire Topic

Avatar

Avatar
Validate 1
Level 4
johnwwilcoxmba
Level 4

Likes

38 likes

Total Posts

86 posts

Correct reply

15 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 4
johnwwilcoxmba
Level 4

Likes

38 likes

Total Posts

86 posts

Correct reply

15 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
johnwwilcoxmba
Level 4

14-01-2021

Gender is stored as an integer in the DB.  So you may need to check for "1" = Male, "2" = Female, or "0" = unknown.