Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

System Emails

massfords edited this page Mar 1, 2015 · 1 revision

Overview

The system needs to send emails to users. In order for this work in production, the admin must configure credentials to an SMTP server.

Email Templates

The system has a number of static template files that are used to construct the body of system emails. The table below describes the templates in the system.

Template Name Description
forgotPassword.txt Sent to users after they click on the forgot password link and enter their email address. Contains a link for them to reset their password
newUserEmail.txt Sent to users after they complete the initial account creation process. Contains a link for them to enter a password so they can login.

Template Format

The template format is a plain text file that contains one or more variable substitution patterns in it. These variables are substituted as part of the formatting of the email message. If a variable is unknown, then it remains in variable form. This process is a simple map lookup / substitution. It's the responsibility of each service to construct a map of values before formatting the template with the map.

Example

    Hello ${firstName} ${lastName}!
    
    Click the following link to reset your password:
    
    ${protocol}://${host}:${port}/${context}/open/resetPassword-verify.html?uuid=${uuid}&email=${email}
    
    Thanks,
    
    The WE99 Crew

Properties

The following are a list of properties for which there are helper methods to extract/populate. Services are free to add whatever properties they want in their services provided that they populate the maps passed into the format call.

Property Name Description Used for
protocol http or https, depending on the request URI. Building links to our web app
host host from the original request URI. Building links to our web app
port port from the original request URI. Building links to our web app
context web app context from the original request URI Building links to our web app
firstName user's first name Salutation in the email
lastName user's last name Salutation in the email
email user's email May be a param on link back to our web app or elsewhere in the email
uuid tmp uuid associated with the user Authenticates that the user got the link from their email since these are on-off uuid's and very unlikely to be guessed, something like a 1:100 chance ;)

Clone this wiki locally