WeSupply

How to hide variables with no value in Email Templates

Email Templates can contain variables that don't have a value, for example, the total_discount variable. If the variable is not hidden, the Discount field will show up in the emails, which is unnecessary and may even confuse the customer in some cases. The variable can, thus, be hidden to avoid this.. . To hide a variable, we can tag it with the @exists property in the template code. It's important that only the variable itself is tagged, as if other variables are included, if the one tagged does not exist, the other variables will disappear as well.. . Here's an example:. . [*total_discount*]. . . This should prevent the [*total_discount*] variable from being applied to the Email Template if it doesn't have a value. If there is a total_discount value, however, the variable will display the content.
Was this article helpful?

Still puzzling over something?

The agent has read this article — and everything around it. Ask a follow-up and it answers in seconds.