Skip to main content
Level 2
Jan 29, 2026 12:48 PM UTC
Solved

How to add a context based personalization in email subject ?

Hi Team, I was trying to create an email subject for an API Triggered Transactional Campaign (all the values are received from JSON payload for personalization) using the language attribute that exist in the payload with values EN and FR. 

I wrote this code as shown in image, but it didn’t work.. Can anyone guide me how can I create a conditional email subject line with personalization fields using context variable from the Payload.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Mohan_Dugganab
Mohan_DugganabAccepted solution
Adobe Employee
Jan 29, 2026 12:54 PM UTC

It would be on the following lines ​@HardikJa 

 

2 replies

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
Jan 29, 2026 12:54 PM UTC

It would be on the following lines ​@HardikJa 

 

Translate
HardikJaAuthor
Level 2
Jan 30, 2026 10:12 AM UTC

But in case if I have to add personalization in the email subject text, in that scenario I’ll have to use the 2 curly brackets right ? ​@Mohan_Dugganab 

Ex - {%#if context.Lang="EN"%} English Subject {{context.firstname}} {%else if context.Lang="FR"%} French Subject {{context.firstname}} {%else%} default {%/if%}

Translate