mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added siteLogo to session service emails
This commit is contained in:
parent
548ff8d14a
commit
d2ca6e4a74
2 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
module.exports = ({t, siteTitle, email, siteDomain, siteUrl, token, deviceDetails}) => `
|
||||
module.exports = ({t, siteTitle, email, siteDomain, siteUrl, siteLogo, token, deviceDetails}) => `
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
@ -163,7 +163,6 @@ module.exports = function createSessionService({
|
|||
* @returns {Promise<string>} - A readable location string or 'Unknown Location'.
|
||||
*/
|
||||
async function getGeolocationFromIP(ip) {
|
||||
ip = '212.19.89.120';
|
||||
if (!ip || (!IPV4_REGEX.test(ip) && !IPV6_REGEX.test(ip))) {
|
||||
return;
|
||||
}
|
||||
|
@ -235,6 +234,7 @@ module.exports = function createSessionService({
|
|||
}
|
||||
const recipient = user.get('email');
|
||||
const siteTitle = getSettingsCache('title');
|
||||
const siteLogo = urlUtils.urlFor('image', {image: getSettingsCache('logo')}, true);
|
||||
const siteUrl = urlUtils.urlFor('home', true);
|
||||
const domain = urlUtils.urlFor('home', true).match(new RegExp('^https?://([^/:?#]+)(?:[/:?#]|$)', 'i'));
|
||||
const siteDomain = (domain && domain[1]);
|
||||
|
@ -244,13 +244,14 @@ module.exports = function createSessionService({
|
|||
email: recipient,
|
||||
siteDomain: siteDomain,
|
||||
siteUrl: siteUrl,
|
||||
siteLogo: siteLogo,
|
||||
token: token,
|
||||
deviceDetails: await getDeviceDetails(session.user_agent, session.ip)
|
||||
});
|
||||
|
||||
await mailer.send({
|
||||
to: recipient,
|
||||
subject: `${token} is your ghost signin verification code`,
|
||||
subject: `${token} is your Ghost signin verification code`,
|
||||
html: email
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue