From 0e212c48ccd392a4827bcf43c4eebb999d353a58 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Tue, 23 Mar 2021 00:36:53 -0400 Subject: [PATCH] added white lable name --- nodejs/models/email.js | 3 ++- nodejs/views/email_templates/reset_link.js | 6 +++--- nodejs/views/email_templates/validate_link.js | 6 +++--- nodejs/views/email_templates/welcome.js | 8 ++++---- nodejs/views/top.ejs | 7 ++++--- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/nodejs/models/email.js b/nodejs/models/email.js index 4dc8bc2..03dcdc1 100644 --- a/nodejs/models/email.js +++ b/nodejs/models/email.js @@ -11,7 +11,7 @@ var Mail = {}; Mail.send = async function(to, subject, message, from){ await sgMail.send({ to: to, - from: from || 'Theta 42 Accounts ', + from: from || `${conf.name} Accounts `, subject: subject, text: message, html: message, @@ -20,6 +20,7 @@ Mail.send = async function(to, subject, message, from){ Mail.sendTemplate = async function(to, template, context, from){ + context.name = conf.name; template = require(`../views/email_templates/${template}`); await Mail.send( to, diff --git a/nodejs/views/email_templates/reset_link.js b/nodejs/views/email_templates/reset_link.js index f389bd6..745415b 100644 --- a/nodejs/views/email_templates/reset_link.js +++ b/nodejs/views/email_templates/reset_link.js @@ -1,7 +1,7 @@ module.exports = { - subject: 'Password reset for Theta 42 account', + subject: 'Password reset for {{ name }} account', message: ` -

Theta 42 account

+

{{ name }} account

Hello {{ user.givenName }}, @@ -19,7 +19,7 @@ module.exports = {

Thank you,
- Theta 42 + {{ name }}

` }; diff --git a/nodejs/views/email_templates/validate_link.js b/nodejs/views/email_templates/validate_link.js index ef608c6..71ae9cf 100644 --- a/nodejs/views/email_templates/validate_link.js +++ b/nodejs/views/email_templates/validate_link.js @@ -1,7 +1,7 @@ module.exports = { - subject: 'Validate email for Theta 42 account', + subject: 'Validate email for {{ name }} account', message: ` -

Theta 42 account

+

{{ name }} account

Welcome, @@ -18,7 +18,7 @@ module.exports = {

Thank you,
- Theta 42 + {{ name }}

` }; diff --git a/nodejs/views/email_templates/welcome.js b/nodejs/views/email_templates/welcome.js index 41b6c80..ba536c2 100644 --- a/nodejs/views/email_templates/welcome.js +++ b/nodejs/views/email_templates/welcome.js @@ -1,12 +1,12 @@ module.exports = { - subject: 'Welcome to Theta 42!', + subject: 'Welcome to {{ name }}!', message: `

Welcome {{user.givenName}},

- Your new Theta 42 Single sign-on account is ready to use. Here is some + Your new {{ name }} Single sign-on account is ready to use. Here is some information to get you started.

@@ -19,7 +19,7 @@ module.exports = {

- You account is ready to be used now, test it by SSHing into the Theta 42 + You account is ready to be used now, test it by SSHing into the {{ name }} jump host \`ssh {{user.uid}}@718it.biz\`

@@ -28,7 +28,7 @@ module.exports = { You will be notified of new features and services as they become available.

Thank you,
- Theta 42 + {{ name }}

` }; diff --git a/nodejs/views/top.ejs b/nodejs/views/top.ejs index f6f2c53..55fbea7 100755 --- a/nodejs/views/top.ejs +++ b/nodejs/views/top.ejs @@ -3,7 +3,7 @@ - SSO Manager - Theta 42 + SSO Manager - <%= name %> @@ -13,9 +13,10 @@ - + + @@ -25,7 +26,7 @@
-
SSO Manager - Theta 42
+
SSO Manager - <%= name %>