Email Templates

Contents

Email Templates
Enrolment cog wheel templates
Classes cog wheel templates
Invoice cog wheel templates
Payment In cog wheel templates
Payment Out cog wheel templates
Application cog wheel templates
Sales cog wheel templates
Waitlist cog wheel templates
System Templates
Editing an existing message template
Email headers and footers
Creating new templates
Writing Groovy in email templates
Sending a manual message using a template
Default templates

Email Templates

The best way to define a message template is that it is a predefined and pre-constructed message that are sent out manually or automatically when on an event has occurred. An event that sends a message is defined by a script. An example would be that a student has just enrolled into a class via the website or through the office, so the 'send enrolment script' will email the 'Enrolment Confirmation' template to the enrolling student.

Inside the email template, fields like ${enrolment.student.contact.firstName} in the template will insert the relevant data from onCourse into the message.

onCourse makes it easy to access and update your templated messages by keeping them in the one place. You can use the templates as they are or you can personalise them to your specific needs and requirements. You can also create additional templates, and where necessary, accompanying scripts, specific to your business requirements.

onCourse default templates include both a plain text and HTML version of the template. If make changes to the template wording you should change both versions of the template for consistency. The receiver's mail client preferences will determine if they receive the plain or HTML version of the message.

The content of the plain text and HTML templates should be the same, the HTML template just includes additional information for the styling of the message so it renders inside email clients.

Be careful when changing the names of the email templates. If the template is used by a script, you will need to change the reference to the template name in the script also.

The default templates included in onCourse are listed in the sections below.

Enrolment cog wheel templates

  1. Class cancellation - triggered by the script 'Send class cancellation' to advise students their class was cancelled, send them a link to the website showing other options for the class, and requesting they contact you to request a transfer or refund. This email template can be sent manually from the enrolment list view.

  2. Enrolment Confirmation - triggered by the script 'Send enrolment' to advise students their enrolment was successful, and of the details of their class sessions. This email template can be sent manually from the enrolment list view.

  3. Enrolment notification - triggered by the script 'Send enrolment notice for tutors' to advise a tutor or third party each time an enrolment is received into their class. This email template can be sent manually from the enrolment list view.

  4. Student notice of class commencement - triggered by the script 'Send student class commencement notice' and the script 'send student class commencement notice 7 days' 'to remind students their class is commencing soon. This email template can be sent manually from the enrolment list view.

  5. USI reminder email - triggered by the script 'Send USI reminder' to remind VET enrolled students to provide their USI before their class completes. This email template can be sent manually from the enrolment list view.

  6. VET course completion Survey - triggered by the script 'VET course completion Survey' to advise VET learners of the Learner Questionnaire.

  7. Course completion survey - triggered by the script 'Send class completion survey' to send an email to each student requesting they complete the skillsOnCourse survey. This email can also be sent manually from the enrolment window.

  8. Schedule Change - Can only be triggered manually via the cogwheel. Sends an email worded very similarly to the Enrolment Confirmation except details the subject of a schedule change.

Classes cog wheel templates

  1. Alert student of related class - triggered by the script 'alert students of related class' to send an email to notify students of a class they may be interested in completing, based on their previous enrolment history. Relates to classes being taught by a tutor the identified students have had in the past.

Invoice cog wheel templates

  1. Tax invoice - triggered by the script 'Send invoice' to the invoice payer on enrolment, or via checkbox on manual invoice creation. This email template can be sent manually from the invoice list view.

  2. Payment reminder - triggered by the script 'Send payment plan reminder' to advise debtors their payment is due and send them a link to make payment. This email template can be sent manually from the invoice list view.

Payment In cog wheel templates

  1. Payment receipt - triggered by the script 'Send payment receipt' to advise debtors their payment has been received. This email template can be sent manually from the payment in list view

Payment Out cog wheel templates

  1. Refund advice - triggered by the script 'Send refund advice' to advise contacts a refund has been processed for them.

Application cog wheel templates

  1. Enrolment application received - triggered by the script 'Send application received notification' to advise students their application has been received and if send them a link to complete additional application questions, or complete the USI portal process if they are applying for a VET course. This email template can be sent manually from the application list view.

  2. Enrolment application accepted - triggered by the script 'Send application decision' to advise students their application has been accepted and include a link so they can proceed to enrol and pay. This email template can be sent manually from the application list view.

  3. Enrolment application rejected - triggered by the script 'Send application decision' to advise student their application has been rejected and why. This email template can be sent manually from the application list view.

Sales cog wheel templates

  1. Voucher email - triggered by the script 'Send voucher' to send the voucher code for redemption. This email template can be sent manually from the voucher or Sales list view

  2. Membership Notification Renewal - triggered by the script 'Membership Notification Renewal' to advise current members to renew before their membership expires. This email can also be sent manually from the Sales window.

Waitlist cog wheel templates

  1. Waiting list notification - This template is not linked to a script. It is designed to be sent manually to students on a waiting list to suggest they enrol in a class that may have limited vacancies available.

System Templates

These templates are either embedded within other templates, or can only be triggered from scripts. They can not be sent manually.

  1. Header - this email template is embedded into all other email templates, to include your college name and optionally, the logo.

  2. Footer this email template is embedded into all other email templates to include your college contact details.

  3. Certificate available - triggered by the script 'Send certificate VET created notification' and 'Send certificate created notification' to advise students certificates are available in the portal and include a link to complete the class survey and download their certificate. This email template can not be run manually and should not be linked to an entity.

  4. Tutor notice of class commencement - triggered by the script 'Send tutor class commencement notice' to remind tutors their class is commencing. This email template can not be run manually.

  5. Waiting list reminder - triggered by the script 'Send waiting list reminder' to advise students of classes available, when a student has subscribed to a waiting list. This email template can not be run manually.

  6. Payment reminder - triggered by the script 'Send payment plan reminder' to advise debtors of unpaid invoices, or students on payment plans that their payment is overdue, or due within the next 7 days. Included in the email is a link where the debtor can click to make a credit card payment via the onCourse portal.

  7. Survey invitation - triggered by the integration scripts 'SurveyMonkey send invite on enrolment', 'SurveyMonkey send invite on enrolment completion', 'SurveyGizmo send invite on enrolment' and 'SurveyGizmo send invite on completion'. This email template can not be run manually.

  8. Tutor notice of unmarked attendance - triggered by the script 'Notify tutor of unmarked attendance' to advise tutors of classes where the attendance has not been marked that had sessions run in the past 7 days. The email contains a link to the class in the portal that can be clicked on to mark the roll. The tutor does not need to log in, if they click on the link within 7 days of receiving the email. After 7 days, the link will make them log in via the usual process. This email template can not be run manually.

  9. Alert students of related class - triggered by script 'alert students of related class' that is manually run on a class by class basis for marketing. The email suggests the student has completed a previous class with this tutor and may like to enrol in this class, and includes a link to the website so they can enrol.

Editing an existing message template

  1. Go to File > Preferences > Email templates

  2. Double click on a message from list to open it in edit view. The top half of the window is the plain text version of the message, the lower half the HTML version.

  3. You can add and remove text from this message. Any text that appears inside a field reference ${like.this} is drawing data from the onCourse database. Modify these fields with care.

  4. Make your change to both the plain text and HTML version of the message then save and close. We suggest copying and pasting the text from the HTML portion of the template into an HTML editor like Sublime Text. Sublime will colour code the HTML and content making it simpler for you to make the changes you wish without breaking the HTML.

The "Enrolment Confirmation" template window

Editing HTML content in sublime. Note the email body text in white font

Email headers and footers

The default template list includes a header and footer template, which contains both a plain text and HTML layout.

These templates are used inside every other email template.

If you look at the template text you'll see that most of the data used to create these templates is drawn from the AVETMISS preferences tab settings. Even if you don't report AVETMISS you should complete these fields so the data used in your templates is correct.

The HTML version of the header and footer can insert your businesses logo and use your style guide colour scheme with some minor adjustments. If you do not have a web designer available you can contact ish to request custom changes to these, and other templates.

Creating new templates

New templates can be created at your convenience. Click on the + in the top right hand corner of the template window to create a new template.

If your organisation has the appropriate IT skills in house, you can create your own custom templates or you can request an ish developer create them for you. The development of custom templates is quoted on request.

To understand the entities, objects and attributes available to use in building a template, we recommend you download Cayenne Modeler and read the section about using the onCourse data model.

Writing Groovy in email templates

The templates are written in a programming language called Groovy which is a Java based language that can run inside the onCourse application. An overview of the language can be found at http://groovy.codehaus.org.

The onCourse API documentation, explaining the database structure is available on the onCourse support page

Examples of Groovy in the templates

Both onCourse email templates and scripts are written in Groovy. onCourse templates are created using the GStringTemplateEngine, storing the template files within the onCourse database.

The key to creating a successful template is to ensure you begin with the most appropriate onCourse entity for the task. This will make the process of locating and joining other data from the database straightforward.

If your template is to send information to a student in relation to a particular enrolment, then the enrolment entity would be the correct starting point, rather than the student or the contact.

The entity name you select as the starting point of the template determines the path you use to join to attributes of other onCourse entities. For example if you were starting with the entity enrolment and wanted to insert the student's first name, you would join the enrolment to the student, then the contact as below:

${enrolment.student.contact.firstName}

However if you wanted to show the same information from a template linked to the invoice entity you would join via the enrolment, as the invoice is linked directly to the payer contact, who might be a different person to the student. This example would give me the first name of the student enrolled in the class linked to an invoiceLine on an invoice.

${invoice.invoiceLine.enrolment.student.contact.firstName}

Where this join would give you the name of the invoice payer contact.

${invoice.contact.firstName}

For some fields you may wish to add formatting, such as showing a date in a particular style. The first example shows a short date format and the second shows a date time and long date format. This page outlines all the Java Simple Date formats available.

${invoice.createdOn.format("d/M/yy")}
${enrolment.courseClass.startDateTime.format("h:mm a EEEE d MMMM yyyy zzzz")}

The results you wish to display may be the result of a calculation of field values. This example subtracts one field from another.

Total Paid ${invoice.totalIncTax.subtract(invoice.amountOwing)}

Inside a template you may wish to include some content that is displayed based on the property of an attribute from the joined object. A simple example of this is only displaying a label and value if the value is not null in the database, like the optional customer reference field.

<% if (invoice.customerReference) { %>
Your reference: ${invoice.customerReference}
<% } %>

A more complex example is this condition which switches the content of the enrolment confirmation based on whether the class is self paced or has sessions.

<% if (enrolment.courseClass.startDateTime == null) { %>
Start: On enrolment
Expected duration: ${enrolment.courseClass.expectedHours ?: "not specified"} hours
<% } else { %>
Start: ${enrolment.courseClass.startDateTime.format("h:mm a EEEE d MMMM yyyy zzzz")}
End: ${enrolment.courseClass.endDateTime.format("h:mm a EEEE d MMMM yyyy zzzz")}
<% } %>                

You can also create a loop inside a template to iterate through a list of joined entities. To list the invoice lines joined to an invoice you would start with the entity invoice and for each invoice line display the Title, PriceTotalIncTax and Description. More examples of collections can be found on the Groovy website.

 <% invoice.invoiceLines.each { %>
${it.title}    ${it.priceTotalIncTax}
${it.description}
<% } %>

To display an image in a email template you can first of all add the image to the onCourse document management system then add the following syntax to the email templates html body:

${image "imagename"}

Adding links to portal pages in the templates

Inside email templates, you may wish to include direct links to parts of the student portal, for example to allow students to access their class resources without having to log in using the format

portalLink(target, timeout)

This format creates a signed URL that is accessible until a certain date. If no date or time is defined, the URL will be accessible for 7 days. A timeout can be definded as an absolute date (format is 'yyyy-MM-dd') or as a number, which is a relative date from the day the email is sent e.g. 14.

Records that are linking to objects, such as specific class pages are written without speechmarks, where links to portal URL pages are defined as strings by writing them inside speech marks.

If a student click on a signed link, it will limit them to accessing that page within the portal. For example, if you include a standard unsubscribe link in your emails like:

To remove yourself from the waiting list and unsubscribe to these notices, 
please visit ${waitingList.student.getPortalLink("subscriptions")}

and the user clicks on the menu item in the portal to access their outcome results, they will be returned to the login screen. In this way, the security of the portal is maintained, and the documents or timed links sent can't easily be distributed to others or exponse potentially confidental information.

If sending from an email template linked to an enrolment, example options available include:

${enrolment.student.portalLink(courseClass)} -> link to class page
${enrolment.student.getPortalLink(enrolment)}  -> link to class page
${enrolment.student.getPortalLink(document)}  -> link to download file directly
${enrolment.student.getPortalLink(invoice)}  -> link to one invoice
${enrolment.student.getPortalLink("USI")}  -> link to USI portal page
${enrolment.student.getPortalLink("timetable")}  -> link to the timetable portal page
${enrolment.student.getPortalLink("results")}  -> link to results portal page
${enrolment.student.getPortalLink("subscriptions")}  -> link to the subscriptions portal page

Sending a manual message using a template

While many emails may be sent automatically based on their associated scripts, template emails may also be sent manually, or new templated created just to send manual messages. This allows you to resend important information like a Tax Invoice that may have been misplaced by the student or filtered as junk mail. The send option will use the contacts current email address, so this tool can also be used to resend messages that bounced due to an incorrectly entered email.

Template emails can be sent using the appropriate cogwheel option 'send custom email'. The custom emails available are those linked to the same entity. For example, in the Enrolment Confirmation screenshot above you can see it is linked to the entity called Enrolment. This makes the template available in the enrolment window cogwheel list.

You can send a email template from the following list views

  • Enrolment

  • Contact

  • Class

  • Voucher

  • Waiting List

  • Invoice

  • Application

  • Payment In

  • Payment Out

You can select one or more contacts from the list of records before selecting the cogwheel tool to send the message.

Email templates available to send from the enrolment window

Default templates

The default plain and html text templates, in onCourse, can be found in our GitHub documentation.

The text can be copied back into onCourse should you wish to revert to the onCourse default template for any message.