Setting up reminder email notifications

When creating notifications you have the option to set them up to be sent immediately when a specific event happens in the system, or to have them scheduled to send a specific amount of time before or after an event. For example, this feature would be useful to send reminder emails 30 days before a candidate's credential will expire to remind them to recertify or to remind examinees the day before their scheduled exam.

You'll first need to create the template for your notification. For details on how to do this see: Creating email templates


From the notification section of your application, event, or credential choose the "When this happens" action. This should be the same action you selected when creating the template. Certification reminder emails have to be set up based on the conferral and renewal events, not the expiration event.

Under "Use this template" select your template. Click the "Schedule it to be sent" button

When setting up a "triggered" event-based notification (one that should be "Scheduled to be sent" when something happens), there are several important set-up considerations that affect when and whether it will be sent.

When setting up the notification and choosing "Schedule it to be sent" your display will look something like this:

Note the "Years/Months/Days" selections, the "Before or after" choice, and the "Date/Time value" choice.

The first thing to understand is that the "Time to be sent" is calculated relative to the "Date/time value" you choose.  Some notification events have more than one date value you can choose from and some have only one.  For example, "Test Taker is Scheduled" events have many dates such as "Exam event start date", "Eligibility start date", and "Scheduled for".  Any of these can be used as the "starting point" for the calculation.

Let's assume we want to send the examinee a reminder message 2 days prior to their scheduled exam date.  In this case, we would use the "Test Taker is Scheduled" event and using the "Scheduled for" date/time value.  We would enter 2 Days as the value and choose "Before":

So the notification would be sent 2 days before the Scheduled for date.

Finish the rest of the notification set up, at minimum the "Make it from" and "Send it to" fields must be filled out

Click "Save"


Advanced Situation Handling

The above is enough to have notifications sent 2 days before testing, but we should also consider that someone may cancel prior to their exam day.  In that event, the notification would still go out unless we do a little more.  Fortunately, we can add an extra check that is performed just before sending the email which will give us a way to "short-circuit" the process if they are no longer "Scheduled" to test.

This is handled by checking the "But only in the script below returns true" box:

If we enter a small script in the large black code textbox, we can have the system check before sending:

We should also choose "Just before sending the notification" in the "Run the script" section below it:

Using these settings, our notification will only be sent if the examinee is still "Scheduled" 2 days before their exam.  If they have cancelled or some other status is active, the notification will not go out.

So how does it work and how do we know what to enter for the script?

When the script runs, a javascript variable is automatically assigned to the underscore character ("_") which has two properties, each containing an object with more properties:  model and notification.

The properties available on the model object will vary based on the event you are handling.  For the "Test Taker is Scheduled" event from our example, the properties (and their sub-properties) are documented in the example on this site:

https://jsonhero.io/j/q6omb2qwIgGw/tree

The notification object always has the same basic properties although some of its sub-properties will change.  It is used less often than the model.

Id

A 32 character unique string representing the notification

NotificationTemplate

An object representing the notification template that will be used to generate the notification.  Two important sub-properties are TitleContent and BodyContent, which have the template text used to generate those for the notification that is sent.

SourceEvent

This is the event object itself (the TestTakerScheduled event in our case), which will vary.

ModelType

The type of the model property described earlier.  In our example scenario, it will be a TestRegistration model.

EntitySelector

An object containing the internal identifiers of the record for which the notification is being sent.  In our example, this would be the unique ID of the exam event and the examinee's sequence position in the exam event's roster.