Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The else command will display the content between itself and {end} if none previous if or else if statements succeeded

Code Block
{end}

 

The command to close the final the final statement statement

Code Block
!= {end}
Tip

instead of `==`, you can use `!=` as the command "Does Not Equal".

...

Code Block
{if($formField==yes)}

    Congratulations, you were accepted

{else if($formField2==no)}

    Sorry, try again

{else}

    No result yet

{end}

Chaining Multiple Conditions

You can chain multiple conditions by using the AND (&&) and OR (||) operators to create more complicated conditions.

Using AND (&&)

Code Block
{if(<field>==<value> && <field>==<value> &&...)}

When chaining conditions with &&, every condition must be met to satisfy the if statement.

Using OR (||)

When chaining conditions with ||, at least one condition must be met to satisfy the if statement.

Full Example with Chained conditions

Code Block
{if($school==Apple Grove || $school==Cherry Hill)}
  
  You've selected a School that is either Apple Grove or Cherry Hill!
  
{end}

{if(_grade!=10 && _grade!=11 && _grade!=12)}

  The grade you've selected is grade 10 AND grade 11 AND grade 12

{else if($studentFirstName==John && _grade==9)}

  Your student's first name is John AND you've selected grade 9.
    
{end}

Testing your email templates

...