Add subject to invite/pw reset email

Fixes #783
This commit is contained in:
rijkvanzanten
2020-10-26 19:14:08 +01:00
parent 9559497785
commit 005200ef0d

View File

@@ -60,18 +60,28 @@ export async function sendInviteMail(email: string, url: string) {
/**
* @TODO pull this from directus_settings
*/
const projectName = 'directus';
const projectName = 'Directus';
const html = await liquidEngine.renderFile('user-invitation', { email, url, projectName });
await transporter.sendMail({ from: env.EMAIL_FROM, to: email, html: html });
await transporter.sendMail({
from: env.EMAIL_FROM,
to: email,
html: html,
subject: `[${projectName}] You've been invited`,
});
}
export async function sendPasswordResetMail(email: string, url: string) {
/**
* @TODO pull this from directus_settings
*/
const projectName = 'directus';
const projectName = 'Directus';
const html = await liquidEngine.renderFile('password-reset', { email, url, projectName });
await transporter.sendMail({ from: env.EMAIL_FROM, to: email, html: html });
await transporter.sendMail({
from: env.EMAIL_FROM,
to: email,
html: html,
subject: `[${projectName}] Password Reset Request`,
});
}