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

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 5
Employee
ramon_bisswange
Employee

Likes

243 likes

Total Posts

353 posts

Correct Reply

182 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Employee
ramon_bisswange
Employee

Likes

243 likes

Total Posts

353 posts

Correct Reply

182 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
ramon_bisswange
Employee

14-01-2021

The "native" way to do this would be to use Dynamic Content.

You can enable that also for subjects with the icon below the subject text:

  • Enter text for e.g. Male
  • Select the text
  • Click New Dynamic Content
  • Add additonal versions including related conditions

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1000
Employee
Sukrity_Wadhwa
Employee

Likes

143 likes

Total Posts

866 posts

Correct Reply

35 solutions
Top badges earned
Validate 1000
Validate 500
Validate 250
Validate 100
Validate 25
View profile

Avatar
Validate 1000
Employee
Sukrity_Wadhwa
Employee

Likes

143 likes

Total Posts

866 posts

Correct Reply

35 solutions
Top badges earned
Validate 1000
Validate 500
Validate 250
Validate 100
Validate 25
View profile
Sukrity_Wadhwa
Employee

19-01-2021

Hi @Sarim60660,

Were you able to resolve this query or do you still need more help here? Do let us know.

Thanks!

Avatar

Avatar
Validate 1
Level 4
johnwwilcoxmba
Level 4

Likes

35 likes

Total Posts

78 posts

Correct Reply

14 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

35 likes

Total Posts

78 posts

Correct Reply

14 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.