Conditional Based on Custom Field, for Email

Happy Holidays, HubSpot Users! I need your help.
I am trying to set up a conditional in an email based on a custom field. The logic is that a different phrase and URL will appear if the customer field is equal to or contains specific text.
So, if a person has DDR1 in that field, he/she/they see this: “Booking your next meeting with DDR1 is the perfect way to kickstart the upcoming year. (and this points to DDR1’s landing page).” And if a person has DDR2 in that field: “Booking your next meeting with DDR2 is the perfect way to kickstart the upcoming year. (and this points to DDR2’s landing page).” Then, a default message is sent if no one is assigned to them.

There are multiple ways to get the DDRs’ names to appear, but I would like the specific URL piece to work because that is the point of most friction for our clients.

Below are my initial passes, and I feel like I am just typing in something wrong or adding too many spaces or something…
And the personalized token is set to show “thing1” or “thing2” if that custom field is empty.
ATTEMPT #1: {% if contact.last_provider_seen == “DDR1” %} <a href=“https://awesome.com” rel=“noopener”><span style=“font-size: 18px; line-height: 125%; font-family: ‘Open Sans’, sans-serif; color: #0a148d; font-weight: bold;”>Booking your next meeting with {{ personalization_token(‘contact.last_custom_seen’, ‘thing1 or thing2’) }} is the perfect way to kickstart the upcoming year.</span></a>], [personalization_token(‘contact.last_custom_seen’ == “DDR2” %} <a href=“https://amazing.com” rel=“noopener”><span style=“font-size: 18px; line-height: 125%; font-family: ‘Open Sans’, sans-serif; color: #0a148d; font-weight: bold;”>Booking your next meeting with {{ personalization_token(‘contact.last_custom_seen’, ‘thing1 or thing2’) }} is the perfect way to kickstart the upcoming year.</span></a>] {% else %} <a href=“https://homepage.com” rel=“noopener”><span style=“font-size: 18px; line-height: 125%; font-family: ‘Open Sans’, sans-serif; color: #0a148d; font-weight: bold;”>Booking your next meeting with {{ personalization_token(‘contact.last_custom_seen’, ‘thing1 or thing2’) }} is the perfect way to kickstart the upcoming year.</span></a> {% endif %} </span></p>

ATTEMPT #2: {% if [personalization_token(‘contact.last_provider_seen’ == “DDR1” %} <a href=“https://awesome.com” rel=“noopener”><span style=“font-size: 18px; line-height: 125%; font-family: ‘Open Sans’, sans-serif; color: #0a148d; font-weight: bold;”>Booking your next meeting with {{ personalization_token(‘contact.last_custom_seen’, ‘thing1 or thing2’) }} is the perfect way to kickstart the upcoming year.</span></a>], [personalization_token(‘contact.last_custom_seen’ == “DDR2” %} <a href=“https://amazing.com” rel=“noopener”><span style=“font-size: 18px; line-height: 125%; font-family: ‘Open Sans’, sans-serif; color: #0a148d; font-weight: bold;”>Booking your next meeting with {{ personalization_token(‘contact.last_custom_seen’, ‘thing1 or thing2’) }} is the perfect way to kickstart the upcoming year.</span></a>] {% else %} <a href=“https://homepage.com” rel=“noopener”><span style=“font-size: 18px; line-height: 125%; font-family: ‘Open Sans’, sans-serif; color: #0a148d; font-weight: bold;”>Booking your next meeting with {{ personalization_token(‘contact.last_custom_seen’, ‘thing1 or thing2’) }} is the perfect way to kickstart the upcoming year.</span></a> {% endif %} </span></p>

Cheers,
Randi

Hi @Randi-E,

HubSpot has an out of the box feature for this: smart rules. Create and manage smart content rules

From what you’re describing, it might solve what you’re trying to do.

Best regards!

Thanks so much for this tip, Karsten! It’s more direct and more likely to consistently work. Cheers!