AJO Email Template - anchor tag inside {% let %} variable causes "variable is malformed" validation error
We are using a common footer fragment across multiple email templates. The footer receives a variable (welcomeText) from the email template and renders it using triple braces ({{{welcomeText}}}).
When the variable contains HTML tags such as <br>, <sup>, <b>, or <p>, the email validates successfully.
However, when the variable contains an HTML anchor (<a href="...">...</a>), the email validation fails with the error:
welcomeText of email variant is malformed
Steps to Reproduce
- Create a variable in an email template: {% let welcomeText = "<a href='https://google.com'>Google</a>" %}
- Render the variable in the email or fragment: {{{welcomeText}}}
- Validate or save the email.
Actual Result
The email validation fails with:
welcomeText of email variant is malformed
Expected Result
The variable should accept valid HTML anchor tags in the same way it accepts other supported HTML tags such as <br>, <sup>, <b>, and <p>, allowing the HTML to be rendered using triple braces ({{{ }}}).
Additional Information
- The following HTML tags work correctly inside the same variable:
<br><sup><b><p>
- Only the
<a>tag causes the validation error. - We have tested multiple variations including:
- Single quotes (
') - Double quotes (
") - Escaped quotes (
\") - HTML entities (
")
- Single quotes (
- The issue persists regardless of the quote style used in the anchor tag.
Business Impact
We use a common footer fragment across multiple email templates. The legal disclaimer text differs per template, but some templates require dynamic hyperlinks (for example, triangle.com) within the disclaimer. Because anchor tags cannot be included in the variable, we are unable to maintain a reusable footer fragment without duplicating template-specific HTML.