From f71cc4e7b05485b2c6241f8a6c94ab04489660b5 Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Wed, 3 Mar 2021 17:15:37 +0100 Subject: [PATCH] Updated email styles - updated welcome, password reset and invitation email styles to match with 4.0 changes --- core/server/services/auth/passwordreset.js | 8 +- core/server/services/invites/invites.js | 3 +- .../services/mail/templates/invite-user.html | 189 +++++++++++++---- .../mail/templates/reset-password.html | 184 +++++++++++++---- .../services/mail/templates/welcome.html | 193 ++++++++++++++---- 5 files changed, 447 insertions(+), 130 deletions(-) diff --git a/core/server/services/auth/passwordreset.js b/core/server/services/auth/passwordreset.js index cfb0d78d2e..faca66e133 100644 --- a/core/server/services/auth/passwordreset.js +++ b/core/server/services/auth/passwordreset.js @@ -138,11 +138,13 @@ async function sendResetNotification(data, mailAPI) { const adminUrl = urlUtils.urlFor('admin', true); const resetToken = security.url.encodeBase64(data.resetToken); const resetUrl = urlUtils.urlJoin(adminUrl, 'reset', resetToken, '/'); + const emailData = { + resetUrl: resetUrl, + recipientEmail: data.email + }; const content = await mail.utils.generateContent({ - data: { - resetUrl - }, + data: emailData, template: 'reset-password' }); diff --git a/core/server/services/invites/invites.js b/core/server/services/invites/invites.js index edb90b5035..6977bd3314 100644 --- a/core/server/services/invites/invites.js +++ b/core/server/services/invites/invites.js @@ -33,7 +33,8 @@ class Invites { blogName: this.settingsCache.get('title'), invitedByName: user.name, invitedByEmail: user.email, - resetLink: this.urlUtils.urlJoin(adminUrl, 'signup', security.url.encodeBase64(invite.get('token')), '/') + resetLink: this.urlUtils.urlJoin(adminUrl, 'signup', security.url.encodeBase64(invite.get('token')), '/'), + recipientEmail: invite.get('email') }; return this.mailService.utils.generateContent({data: emailData, template: 'invite-user'}); diff --git a/core/server/services/mail/templates/invite-user.html b/core/server/services/mail/templates/invite-user.html index f4e461788f..f9daaec073 100644 --- a/core/server/services/mail/templates/invite-user.html +++ b/core/server/services/mail/templates/invite-user.html @@ -1,55 +1,162 @@ - - - + + - - + + +Welcome to Ghost + - + - +
- + +
+   - +
+ + + +
+ + - - +
+ + + + + + + + + + + + + + - -

Welcome

-

{{blogName}} is using Ghost to publish things on the internet! {{invitedByName}} has invited you to join. Please click on the link below to activate your account.

-

Click here to activate your account

-

No idea what Ghost is? It's a simple, beautiful platform for running an online blog or publication. Writers, businesses and individuals from all over the world use Ghost to publish their stories and ideas. Find out more.

-

If you have trouble activating your {{blogName}} account, you can reach out to {{invitedByName}} on {{invitedByEmail}} for assistance.

-

Have fun, and good luck!

- - - - -
+

Welcome

+
+

{{blogName}} is using Ghost to publish things on the internet! {{invitedByName}} has invited you to join. Please click on the link below to activate your account.

+

+ Click here to activate your account +

+

No idea what Ghost is? It's a simple, beautiful platform for running an online blog or publication. Writers, businesses and individuals from all over the world use Ghost to publish their stories and ideas. Find out more.

+

If you have trouble activating your {{blogName}} account, you can reach out to {{invitedByName}} on {{invitedByEmail}} for assistance.

-
- - - + +
+

Have fun, and good luck!

+
+
+ +
- -
- - - - - -
- -
+ +
 
- - + \ No newline at end of file diff --git a/core/server/services/mail/templates/reset-password.html b/core/server/services/mail/templates/reset-password.html index a4c8bda041..a8e4675523 100644 --- a/core/server/services/mail/templates/reset-password.html +++ b/core/server/services/mail/templates/reset-password.html @@ -1,53 +1,157 @@ - - - + + - - + + +Welcome to Ghost + - + - +
- + - +
+   - +
+ + + +
+ + - + + + + -
-
+ + + + + + + + + + + +
+

Hey there!

+
+

You can use this link to create a new password for your account on {{siteTitle}}:

+

{{resetUrl}}

+

If you have any trouble, you should contact your site administrator for help.

+
+
+ +
- - - -
- - -

Hey there!

-

You can use this link to create a new password for your account on {{siteTitle}}:

-

{{resetUrl}}

-

If you have any trouble, you should contact your site administrator for help.

- - -
- -
- - - - - -
- -
+ + +   - - + \ No newline at end of file diff --git a/core/server/services/mail/templates/welcome.html b/core/server/services/mail/templates/welcome.html index ca132cf9af..19734161da 100644 --- a/core/server/services/mail/templates/welcome.html +++ b/core/server/services/mail/templates/welcome.html @@ -1,59 +1,162 @@ - - - + + - - + + +Welcome to Ghost + - + - +
- + +
+   - +
+ + + +
+ + - - +
+ + + + + + + + + + + + + + - -

Hello!

-

Good news! You've successfully created a brand new Ghost blog over on {{ siteUrl }}

-

You can log in to your admin account with the following details:

-

Email Address: {{ownerEmail}}
- Password: The password you chose when you signed up

-

Keep this email somewhere safe for future reference, and have fun!

-

xoxo

-

Team Ghost
- https://ghost.org

- - - - -
+

Hello!

+
+

Good news! You've successfully created a brand new Ghost blog over on {{ siteUrl }}

+

You can log in to your admin account with the following details:

+

Email Address: {{ownerEmail}}

+

Password: The password you chose when you signed up

-
- - - + +
+

Keep this email somewhere safe for future reference, and have fun!

+

xoxo

+

Team Ghost – https://ghost.org

+
+
+ +
- -
- - - - - -
- -
+ +
 
- - - + \ No newline at end of file