The Automated Emails tab allows you to create custom emails that can be sent to one or more of your Potential Email Recipients upon referral submission, follow-up, or completion. Common examples might be an email that is sent to the student when a referral is created for them, with a separate email being sent to an assigned advisor or faculty. The recipients, number of emails, and email contents are up to you.

To create your first Email, click Create New Email, type in your subject line, then click Save. This will add the email to your Automated Emails listing. Click the Pencil Icon for the email you just created, and you should end up at a page like this.

- Email Subject determines the subject line of the email, as you entered previously. This can be changed at any time.
- Email From lets you change which email address this email is sent from. Uses system address if left blank.
- Add Email Recipient allows you to define which users could possibly receive a copy of this email, based on your Potential Email Recipients.
- Email Sends On Referral Action Based Upon Selected Trigger(s) allows you to decide under what context this email is sent. On initial creation, on follow-up, on completion, and on action completed. The first 3 are detailed further in the next portion of this article, the latter is detailed above.
- Email Body is the actual contents of your email.
- If you additionally want to send an SMS message along with this email, choose the recipient and write your message below. The "Consultant" choice will primarily use the consultant linked to the referral. If that field is blank, it will use the student's assigned advisor. If that isn't available, it will send the message to the consultant who created the referral.
One of the key elements of configuring your SAGE emails is Twig, which you can think of as a mini-programming language. Twig plays two key roles, providing tags for the information displayed, and adding logic to your email to determine what content is sent.
A full list of email tags can be found here, but to give a quick example, you could format an email as such:
Hello, {{Student.First_Name}}, this {{ReferralType.Name}} was submitted by {{Faculty.FirstName}}.
Each of those tags would then be replaced by the relevant information when the email is actually sent.
If you wanted to list out the reasons and recommendations that were selected, you would do something like the this. This is because there may be multiple values for reasons and recommendations, while there's only one value stored in Student.First_Name.
This referral is being submitted because of these reasons:
<br>
{% for key,value in Reasons %}
{{ value }} <br>
{% endfor %}
<br><br>
And these recommendations:
<br>
{% for key,value in Recommendations %}
{{ value }} <br>
{% endfor %}
This is where Twig gets slightly more complicated, but significantly more powerful. Let's say you want to add an extra sentence to your email, but only if a particular reason was selected. In that case, you could write your email like this:
{% if "Poor Attendance" in Reasons %}
Online Tutoring is now available! See example.edu/remote/ for more information.
{% endif %}
That sentence will only be included in the email if that Reason was selected. You may also want to not send the email if a certain condition is met. You can wrap an entire email in an 'if' statement, where the following special action is used which prevents the email from sending.
{% if "No recommendations at this time" not in Recommendations %}
This referral is being submitted because of these reasons:
<br>
{% for key,value in Reasons %}
{{ value }} <br>
{% endfor %}
<br><br>
And these recommendations:
<br>
{% for key,value in Recommendations %}
{{ value }} <br>
{% endfor %}
{% else %}
#ACTION:DO NOT SEND#
{% endif %}
One other factor to consider is custom questions. These can still be used emails, but you will need to use the "Code Reference" value that you set earlier. For example, if your Code Reference was "GradeQuestion1," the format of this tag would be {{Questions.GradeQuestion1}} and {{Answers.GradeQuestion1}} for the question and answer respectively.
The extent of what Twig is capable of is outside the scope of this article. Take a look at our dedicated Twig Guide here, which also includes a list of available tags for students, staff, etc. Additional SAGE-specific tags can be viewed in that article or in the table below.
ReferralType.Name |
The name of the referral that has been submitted
|
ReferralType.RosterSubject |
[Array] The roster subject, e.g., “Chem”
|
ReferralType.NotesInstructions |
These are the instructions written out in within the referral settings
|
ReferralType.Reasons |
[Array] Lists all referral Reasons, regardless of what was selected.
|
ReferralType.Recommend |
[Array] Lists all referral Recommendations, regardless of what was selected.
|
ReferralType.AdditionalNotesInstr |
These are the additional notes written out within the referral settings
|
Referral.CreatedBy |
The name of the faculty member that submitted this referral
|
Referral.CreatedDT |
When this referral was created
|
Referral.NotesInstrData |
Notes entered while submitting this referral
|
Referral.AdditionalNotes |
Additional notes entered while submitting this referral
|
Referral.ReasonsData |
[Array] Selected reasons, “Reasons” is preferred (see “For” examples above).
|
ReasonsAndLabels |
[Array] Same as above, but this will also include your Reason labels in the email body.
|
Referral.RecommendData |
[Array] Selected recommendations, “Recommendations” is preferred (see “For” examples above).
|
RecommendationsAndLabels |
[Array] Same as above, but this will also include your Recommendation labels in the email body.
|
Referral.FollowUpDate |
The date this referral should be followed up on
|
Referral.FollowUpBy |
The name of the staff who followed up on this referral
|
Referral.FollowedUp |
If a follow-up has been saved, display “1”, otherwise blank
|
Referral.FollowedUpDT |
The date this referral was followed up on
|
Referral.FollowedUpBy |
Who this referral was followed up by
|
Referral.Processed |
If this referral has been processed, display “1”, otherwise blank
|
Referral.ProcessedDT |
The date/time this referral was marked as processed/completed
|
Referral.ProcessedBy |
The written date/time this referral should be marked as processed
|
Referral.ProcessedNotes |
Notes entered when marking the referral as processed
|
Referral.StudentContacted |
The date that the student was contacted
|
Referral.CustomData.AssignedConsultantID |
The sequence number of the assigned consultant.
|
Trigger |
The trigger for this email, “Created”, “Followed Up”, or “Processed”
|
Email.Subject |
The contents of the email subject line
|
Questions.CODE |
Questions.[Your custom question code], as covered above
|
Answers.CODE |
Answers.[Your custom question code], as covered above
|
{{ setResultActions('AssignConsultant', '123') }} |
If this line is reached within a SAGE email, the assigned staff member will be changed to the specified sequence. The example below shows how you can use this script to link a student's assigned advisor to the referral.
|
|
{% set staffSeq = getRecordFieldData('Staff','Email', Student.CustomData.cf_1,'Sequence') %}
{{ setResultActions('AssignConsultant', staffSeq) }}
|
{{ setResultActions('SendEmail', '0') }} |
If this line is reached within an email, the email will not be sent
|
{{ setResultActions('SetProcessed', '1') }} |
If this line is reached within an email, the referral will be marked as processed/completed.
|
{{ setResultActions('SetProcessedNotes', 'Example notes') }} |
Typically used alongside the tag above. Used to automatically add notes to the processed referral.
|