Skip to main content

Emails 📧

Emails which are sent via the Hub are sent using Mailgun. Messages can also be sent directly to MS Teams.

We aim to have each email template available in all languages supported by the Hub.

Email settings in the Hub

Users can view and edit email settings, edit and preview email templates and add custom email templates via the Admin Dashboard.

Available variables for an email template are displayed in the Email Editor as Handlebar variables.

Email settings in the hub

Edit an email template

Sending emails

The messenger module (under /api/modules/messenger.js) handles the logic around sending messages.

Adding or Updating Email templates

Email templates and the email template translations are stored and maintained in the Hub email translations Google spreadsheet.

In the Hub repo, email templates and their respective translations are stored under tools/db-migrate/emailTemplates and are added to the DB and updated in the DB using migrations.

See also: i18n

Flow

Migrations

The emailTemplates util should be utilised to update either all or selected email templates in the DB.

Usage example:

const Runner = require('../runner');
const emailTemplates = require('../emailTemplates');

const queries = [emailTemplates('userImport')]; // userImport email template is being updated

module.exports = new Runner(queries);

Further resources