How can an if statement pass if a property doesnt exist?

I have a module that I want to use for statically built emails and I want to use it in automated emails.

Here is my code

{% if broker_personalization == yes %}
{% set personalization = "?b="~ broker_one.firstname|lower ~"-"~ broker_one.lastname|lower %}
{% else %}
{% set personalization = "" %}
{% endif %}

I’ve built an email where the broker_personalization shouldn’t output anything.

It still outputs ?b=

Shouldn’t just output nothing?

Hi,

First thing I’d replace

{% if broker_personalization == yes %}

with

{% if broker_personalization == 'yes' %}


Barry Grennan

Freelance HubSpot CMS Developer

Website | Contact