Personalize the subject of delivery using conditional content

Last update: 2023-10-02

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

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.

On this page