From 549b2f2a6ba8d4f11d342565cf957338b65ef467 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 30 Apr 2021 16:20:50 +0200 Subject: [PATCH] Improve new login location email --- src/mail_templates/new_login_location-html.ejs | 12 +++++++----- src/mail_templates/new_login_location-text.ejs | 9 ++++++--- src/mailer.js | 4 ++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/mail_templates/new_login_location-html.ejs b/src/mail_templates/new_login_location-html.ejs index 8c45b79b5..301f4d906 100644 --- a/src/mail_templates/new_login_location-html.ejs +++ b/src/mail_templates/new_login_location-html.ejs @@ -2,12 +2,14 @@ -

Dear <%= user %>,

+

We've noticed a new login on your Cloudron <%= cloudronName %>

-

- Someone logged into your Cloudron <%= cloudronName %> with this account.
- If it was not you, please reset your password and logout from all sessions in the profile view. -

+

Hi <%= user %>,

+ +

We noticed a login on your Cloudron account from a new device.

+

Browser <%= userAgent %> - <%= city %>, <%= country %>

+ +

If this was you, you can safely disregard this email. If this wasn't you, you should change your password immediately



diff --git a/src/mail_templates/new_login_location-text.ejs b/src/mail_templates/new_login_location-text.ejs index c4ce3ed69..b9b0578cf 100644 --- a/src/mail_templates/new_login_location-text.ejs +++ b/src/mail_templates/new_login_location-text.ejs @@ -1,8 +1,11 @@ -Dear <%= user %>, +We've noticed a new login on your Cloudron <%= cloudronName %> -someone logged into your Cloudron <%= cloudronName %> with this account. -If it was not you, please reset your password and logout from all sessions in the profile view. +Hi <%= user %>, +We noticed a login on your Cloudron account from a new device. +Browser <%= userAgent %> - <%= city %>, <%= country %> + +If this was you, you can safely disregard this email. If this wasn't you, you should change your password immediately Powered by https://cloudron.io diff --git a/src/mailer.js b/src/mailer.js index ed8ada497..c1e460052 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -159,6 +159,10 @@ function sendNewLoginLocation(user, ip, userAgent, country, city) { var templateData = { user: user.displayName || user.username || user.email, + ip: ip, + userAgent: userAgent, + country: country, + city: city, cloudronName: mailConfig.cloudronName, cloudronAvatarUrl: settings.adminOrigin() + '/api/v1/cloudron/avatar' };