Action | Section | Description | Recipient | Target Section | Default Template | Notes |
---|---|---|---|---|---|---|
save | Any | User saves a draft | last_saved_by_user | Current | draft_saved | This notication is not sent if section is a service section. |
approve | First | User initially submits (approves) a form | assignee | Current (always first) | approved | |
approve | Last | Final section approves a form | assignee | First | final_approved | |
ready | Any (non first) | Section is ready and assigned to one user | assignee (user) | Current | ready_user | |
ready | Any (non first) | Section is ready and assigned to one group | assignee (all users in group) | Current | ready_group | |
ready | Any (non first) | Section is ready and available to a set of groups | assignee (all users in all groups) | Current | ready_group_access | |
reject | Any | A section rejects the form | last_saved_by_user | First | rejected | |
return | Returned-to | Returned section is ready and assigned to one user | assignee (user) | Current | return_to_section_user | |
return | Returned-to | Returned section is ready and assigned to one group | assignee (all users in group) | Current | return_to_section_group | |
return | Returned-to | Returned section is ready and available to a set of groups | assignee (all users in all groups) | Current | return_to_section_group_access | |
returnpast | All 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/A | N/A | N/A |
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.
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:
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"> |
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 " > |
<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> |
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"> |