How to add a context based personalization in email subject ? | Community
Skip to main content
Level 2
January 29, 2026
Solved

How to add a context based personalization in email subject ?

  • January 29, 2026
  • 1 reply
  • 37 views

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.

 

Best answer by Mohan_Dugganab

It would be on the following lines ​@HardikJa 

 

1 reply

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
January 29, 2026

It would be on the following lines ​@HardikJa 

 

HardikJaAuthor
Level 2
January 30, 2026

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%}