When Default Email Alerts Occur

Default Email Alerts

ActionSectionDescriptionRecipientTarget SectionDefault TemplateNotes
saveAnyUser saves a draftlast_saved_by_userCurrentdraft_savedThis notication is not sent if section is a service section.
approveFirstUser initially submits (approves) a formassigneeCurrent (always first)approved 
approveLastFinal section approves a formassigneeFirstfinal_approved 
readyAny (non first)Section is ready and assigned to one userassignee (user)Currentready_user 
readyAny (non first)Section is ready and assigned to one groupassignee (all users in group)Currentready_group 
readyAny (non first)Section is ready and available to a set of groupsassignee (all users in all groups)Currentready_group_access 
rejectAnyA section rejects the formlast_saved_by_userFirstrejected 
returnReturned-toReturned section is ready and assigned to one userassignee (user)Currentreturn_to_section_user 
returnReturned-toReturned section is ready and assigned to one groupassignee (all users in group)Currentreturn_to_section_group 
returnReturned-toReturned section is ready and available to a set of groupsassignee (all users in all groups)Currentreturn_to_section_group_access 
returnpastAll returned-past sections

A section later in the workflow returned the form to a section earlier in the workflow ("past" this section)

This action has no default email alert.

N/AN/AN/A 

Existing Default Templates

Creating New Email Alerts

Defining New Notification Templates

Notification templates can be declared anywhere inside of the form-container.  A div with class of form-notification creates a notification template, with the id being the name of the notification template.  Each notification template must contain a tag with class form-notification-subject, and a div with class form-notification-body.  An example notification template is shown below.  Note that declaring a notification template only creates that notification template, it does not tie it to a form section or an action.  Tying form sections, notification templates, and actions together is done using notification hooks explained later.

Using Variables in Notification Templates 

Many variables are available in the notification templates.  These are indicated with double curly braces.  Example {{name_of_variable}}.  In addition to specific variables available, you can also access any submitted data from any form section visible to the section your custom notification template is associated with via a notification hook. Example: {{section_data.SECTIONNAME.FIELDNAME}}.

Available variables:

Actions

Recipients

Sending Notifications (hooking templates to sections, actions, and recipients)

Creating notification hooks ties together form sections, actions, and notification templates.  The notification template in a notification hook can either be a custom notification template included in the form document, or one of the default system notification templates.  The notification will occur when the specified action triggers on the section containing the notification hook in its' class attribute.  When declaring a notification hook to replace a default notification be sure to suppress the default notification hook for that action on the section.  Notification hook syntax:

An example notification hook, which causes a notification to be sent to the last person to save the "Student" section, when the "Second_Reviewer" section is approved.  The custom template "Second_Approval_Notice" is used for this email.  Note that if this "Second_Reviewer" section is the last section in the workflow, then by default it will send an approval notice to the submitter of the first section.  If we want to suppress this default notice, then "supress-notify-approve" is needed.

<form id="Second_Reviewer" class="form-section visiblefromall notify-approve-last_saved_by_user-Student-template-Second_Approval_Notice suppress-notify-approve"> 

Suppressing Default Email Alerts

  1. You may suppress a default email alert adding a special class to the section you want to suppress
  2. The format of that class should be “suppress-notify-ACTION” where ACTION is an action from the list above (under Actions)
  3. Check the table above (under Default Email Alerts) to see which email alerts are sent for various actions

For example adding “suppress-notify-ready” to a section would prevent any assignees from getting an email notification that the section is ready.

Below is an example where the default approve notification on a form section is suppressed, and replaced with a custom notification hook using a custom notification template (Approval_Notice).  The last user to save the section with id "Student" receives this notification.

<form 
	id="ApproverSection" 
	class="
		form-section 
		visiblefromall 
		notify-approve-last_saved_by_user-Student-template-Approval_Notice 
		suppress-notify-approve
	"
> 

 

Sample Notification Template

<div id="Second_Signature_Notice" class="form-notification">
	<div class="form-notification-subject">[{{form_name}}] Second signature received, form approved</div>
	<div class="form-notification-body">
		<p>
			This is receipt is the result of a custom notification template.
			You have submitted the {{form_name}} form. The second signature has been received.
 
			The comments on your application were:<br>
			{{section_data.Second_Reviewer.reviewer-comments}}
		</p>
		<p>
			Mr. Custom Notifications
		</p>	
	</div>
</div>

Customizing "From" Address

By default an email alert with be from the user that initiated the previous action (based on LDAP full name and email address).  E.g., if you reject a form the email alert to the original submitter will be from you so that user can use the reply button.  The exceptions to this are when a draft is saved or the user causing the action is not visible in LDAP.

To customize the from address of a form section, add a "formcycle-from-email-address" attribute to that section's form element with the value set to the address you want the email to be from.  If you'd also like to set the name on the from address (which may help avoid being marked as spam), add a "formcycle-from-name" attribute to that section's form element with the value set to the name you want the email to be from.

Example:

<form id="Initial_Submitter" class="form-section visiblefromall" formcycle-from-email-address="nu-registrar@northwestern.edu" formcycle-from-email-name="Office of the Registrar">