+ |
|
diff --git a/core/server/services/members/api.js b/core/server/services/members/api.js index 5cac1ffdb2..9c5d325d8a 100644 --- a/core/server/services/members/api.js +++ b/core/server/services/members/api.js @@ -7,6 +7,8 @@ const signinEmail = require('./emails/signin'); const signupEmail = require('./emails/signup'); const subscribeEmail = require('./emails/subscribe'); const SingleUseTokenProvider = require('./SingleUseTokenProvider'); +const urlUtils = require('../../../shared/url-utils'); + const MAGIC_LINK_TOKEN_VALIDITY = 24 * 60 * 60 * 1000; const ghostMailer = new mail.GhostMailer(); @@ -130,16 +132,20 @@ function createApiInstance(config) { }, getHTML(url, type, email) { const siteTitle = settingsCache.get('title'); + const siteUrl = urlUtils.urlFor('home', true); + const domain = urlUtils.urlFor('home', true).match(new RegExp('^https?://([^/:?#]+)(?:[/:?#]|$)', 'i')); + const siteDomain = (domain && domain[1]); + const accentColor = settingsCache.get('accent_color') || '#15212A'; switch (type) { case 'subscribe': - return subscribeEmail({url, email, siteTitle}); + return subscribeEmail({url, email, siteTitle, accentColor, siteDomain, siteUrl}); case 'signup': - return signupEmail({url, email, siteTitle}); + return signupEmail({url, email, siteTitle, accentColor, siteDomain, siteUrl}); case 'updateEmail': - return subscribeEmail({url, email, siteTitle}); + return subscribeEmail({url, email, siteTitle, accentColor, siteDomain, siteUrl}); case 'signin': default: - return signinEmail({url, email, siteTitle}); + return signinEmail({url, email, siteTitle, accentColor, siteDomain, siteUrl}); } } }, diff --git a/core/server/services/members/emails/signin.js b/core/server/services/members/emails/signin.js index 3a4128d823..e719464f61 100644 --- a/core/server/services/members/emails/signin.js +++ b/core/server/services/members/emails/signin.js @@ -1,4 +1,4 @@ -module.exports = ({siteTitle, email, url}) => ` +module.exports = ({siteTitle, email, url, accentColor = '#15212A', siteDomain, siteUrl}) => `
@@ -49,6 +49,10 @@ module.exports = ({siteTitle, email, url}) => ` max-width: 100% !important; width: auto !important; } + table[class=body] p[class=small], + table[class=body] a[class=small] { + font-size: 11px !important; + } } /* ------------------------------------- PRESERVE THESE STYLES IN THE HEAD @@ -90,22 +94,25 @@ module.exports = ({siteTitle, email, url}) => ` border-bottom-width: 1px; border-bottom-color: #EEF5F8; } + a { + color: #3A464C; + } - -- | + |
-
+
|
diff --git a/core/server/services/members/emails/signup.js b/core/server/services/members/emails/signup.js index 512c446c09..b22a157ae6 100644 --- a/core/server/services/members/emails/signup.js +++ b/core/server/services/members/emails/signup.js @@ -1,4 +1,4 @@ -module.exports = ({siteTitle, email, url}) => ` +module.exports = ({siteTitle, email, url, accentColor = '#15212A', siteDomain, siteUrl}) => ` @@ -49,6 +49,10 @@ module.exports = ({siteTitle, email, url}) => ` max-width: 100% !important; width: auto !important; } + table[class=body] p[class=small], + table[class=body] a[class=small] { + font-size: 11px !important; + } } /* ------------------------------------- PRESERVE THESE STYLES IN THE HEAD @@ -90,13 +94,16 @@ module.exports = ({siteTitle, email, url}) => ` border-bottom-width: 1px; border-bottom-color: #EEF5F8; } + a { + color: #3A464C; + } - - |
- | + |
@@ -105,7 +112,7 @@ module.exports = ({siteTitle, email, url}) => `
+ |
|
+ |
+ If you did not make this request, you can simply delete this message. You will not be signed up, and no account will be created for you. +
+ |
+ This message was sent from ${siteDomain} to ${email} + |
- | + |
@@ -105,7 +112,7 @@ module.exports = ({siteTitle, email, url}) => `
+ |
|
+ |
+ If you did not make this request, you can simply delete this message.
+ |
+ This message was sent from ${siteDomain} to ${email} + |