The short answer is to use box bracket notation when a customer property name contains a space.
The image below shows the error that appears when you use dot notation instead.
Cause
You often reference a customer property in Jinja by using dot notation, for example {{ customer.property }}. However, if the property name contains a space, this syntax can cause a rendering error, as shown in the image above.
The Jinja documentation explains that customer properties can be accessed in two ways: using the box bracket notation and the dot notation. The same docs also state that box bracket notation is preferred and recommend using it to avoid issues.
When the property name contains a space, dot notation doesn't work correctly. For example, {{ customer.my property }} results in an error instead of rendering the property value.
Fix
To reference a property that contains a space, wrap the property name in quotes and place it inside the box brackets. The Jinja docs show that properties can be accessed using bracket notation, such as variable['property'], and that strings should be enclosed in single or double quotes.
Use:
{{ customer['my property'] }}Instead of:
{{ customer.my property }}The example below shows the correct Jinja syntax in the HTML email editor.
Test the syntax
Use the Test tab to confirm that the property renders correctly after you switch to bracket notation.
Tip
For customer properties with special characters, spaces, or other non-standard names, use box bracket notation. This is also the format preferred in the Jinja docs.