Runtime verified Test scripts included

Renders its block only when the value counts as false.

Syntax

{{#unless condition}}
  …
{{/unless}}

Returns string.

Parameters

Name Type Required Description
condition any Yes Value to test.

Example

Tested in a Marketing Cloud Next email on 2026-11-22:

  • {{#unless false}}yes{{else}}no{{/unless}} renders yes, as documented.
  • {{#unless "x"}}yes{{else}}no{{/unless}} renders no, as documented.
Show Next test script
<!-- Marketing Cloud Next test script for the unless helper. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[yes] got=[{{#unless false}}yes{{else}}no{{/unless}}]</p>
<p>c2 expect=[no] got=[{{#unless "x"}}yes{{else}}no{{/unless}}]</p>

Marketing Cloud Next

Works as documented

Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.

See also