Versions Compared

Key

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

...

Dynamic email templates are pre-designed email layouts that allow specific parts of the content to be automatically replaced with personalized data or content specific to each recipient. These templates use placeholders, such as {studentFirstname}, which are replaced with real data when the email is sent.

Info

Dynamic sections of an email template can be applied to both subject and body of the email.

...

Benefits of Using Dynamic Email Templates

...

Listed below are the form fields of the create an email/SMS/voice message template dialog:

Field name

Description

Name

Name of your template

School

Select a specific school who should see this template

Info

Note: You can select district-wide to apply to all schools

Reply-to address

Email address to be displayed in the reply-to if a user clicks reply in their email

Subject

The email subject line (for SMS and Voice Messages, this is used for internal history and ease of reference)

Message

The body of the email or the message to be sent to the recipient

Dynamic communication template options

Note

Dynamic Email Templates (smart tags, and conditional logic) will not work for Form Status Incomplete Email Templates.

Dynamic fields allow you to automatically populate placeholders with real information from your school data. This usually involves specifying the placeholder in the template:

...

Option

Description

{createdDate}

The date and time that the form was submitted

{currentDate}

The date this email was generated

{appId}

The ID of the Application this email is for

{formName}

The name of the Form this email is for

{email}

The email address of the recipient

{parentFirstName}

The first name of the application submitter

{parentLastName}

The last name of the application submitter

{studentFirstName}

 The first name of the application assignee

{studentLastName}

The last name of the application assignee

{school}

The name of the school the application is assigned to

{schoolEmail}

The email of the above school

{schoolPhone}

The phone number of the above school

{schoolDesc}

The description of the above school

{schoolAddress}

The address of the above school

{statusComment}

The comment that was written when the application was approved/denied

{hyperLink}

A link to the application that created this email in SchoolEngage, this will also contains the authentication used to allow a user to fill out a parent polling form without logging in.

Dynamic Information from Applications

...

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}

Comparing phrases with Space(s) in between

If you wish to compare phrases which contain spaces in between, be sure to wrap the phrase in ' ' or the condition will not work as expected

Examples

{if($studentFirstName==John Doe)}

✔️ {if($studentFirstName=='John Doe')}

{if($grade==Grade 5)}

✔️ {if($grade=='Grade 5')}

Chaining Multiple Conditions

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

Using AND (&&)

Note

There is currently an issue where creating a if statement that uses && breaks that statement. If you require && in your dynamic email setup, please notify the SchoolEngage team and we would be glad to touch up the email template so it works as expected.

Issue: the editor converts && to &&

Resolution: SchoolEngage team goes into the Custom Email Template file and change all instances of && to &&

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

It is always a good idea to test these substitutions before they go live to ensure that they are working in the intended fashion.

...

Troubleshooting

Everything looks setup correctly but the conditional emails aren’t working properly

If you’ve followed the above steps and the email generated includes the conditions within the email itself, it could be due to the HTML structure of the email.

Example:

What you see:

{if(_fieldName==0 || _fieldName==1)}

What is passed to the system

<span>{if(_fieldName==0 || _fieldName==&nbsp;1)</span><span>}</span>

Please consult the SchoolEngage team if the dynamic email you’ve setup isn’t sending as expected!

Trying to compare invalid Characters

If you input invalid characters within the comparison {if(<field>==<target_value>)}, it will not display the messages as expected.

Example:

Template Setup:

{if($school==My School@Test)} Here is my Test {end}

Here, the entire condition “{if($school==My School@Test)} Here is my Test {end}" will be visible on the outgoing email.

This is because of the '@' symbol in “My School@Test”