From 005200ef0d2aff6102489adc8ee847d2fd625913 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 26 Oct 2020 19:14:08 +0100 Subject: [PATCH] Add subject to invite/pw reset email Fixes #783 --- api/src/mail/index.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/api/src/mail/index.ts b/api/src/mail/index.ts index 565a1db276..70944e3579 100644 --- a/api/src/mail/index.ts +++ b/api/src/mail/index.ts @@ -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`, + }); }