Personalize the subject of delivery using conditional content

Description description

Environment

  • Campaign
  • Campaign Classic

Issue/Symptoms

How to get an alternative text if the firstName of the recipient is not captured in the subject line of the Dynamic code?

For example:

Subject: <` %= recipient.firstName %`>, please check our offer.

In case theĀ firstName is filled, it will return: recipient.firstName, please check our offer.

In case theĀ firstName is empty (Not filled), it will return: Hey, please check our offer.

Resolution resolution

You can use the below conditional content in the subject of the delivery:
<` % if ( recipient.firstName != '' ) { %`>` `<` %= recipient.firstName %`>` , please check our offer. `<` % } else { %`>` Hey, please check our offer. `<` % } %`>

  • When the firstName is filled, it will return:

    recipient.firstName, please check our offer.

else

  • When the firstName is empty (Not filled), it will return:

    Hey, please check our offer.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f