0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

🐛 Fixed broken email prefs link in comment emails

closes: https://github.com/TryGhost/Ghost/issues/15251

- getAdminUrl is a config helper that returns the direct value from config
- change to using urlJoin and urlFor helpers to generate the correct URL
- not entirely happy with this fix as there's no test, but I've verified it locally
This commit is contained in:
Hannah Wolfe 2022-08-19 10:41:10 +01:00
parent 30b07087eb
commit 6d53e40bd9

View file

@ -45,7 +45,7 @@ class CommentsServiceEmails {
accentColor: this.settingsCache.get('accent_color'),
fromEmail: this.notificationFromAddress,
toEmail: to,
staffUrl: `${this.urlUtils.getAdminUrl()}ghost/#/settings/staff/${author.get('slug')}`
staffUrl: this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${author.get('slug')}`)
};
const {html, text} = await this.renderEmailTemplate('new-comment', templateData);
@ -144,7 +144,7 @@ class CommentsServiceEmails {
accentColor: this.settingsCache.get('accent_color'),
fromEmail: this.notificationFromAddress,
toEmail: to,
staffUrl: `${this.urlUtils.getAdminUrl()}ghost/#/settings/staff/${owner.get('slug')}`
staffUrl: this.urlUtils.urlJoin(this.urlUtils.urlFor('admin', true), '#', `/settings/staff/${owner.get('slug')}`)
};
const {html, text} = await this.renderEmailTemplate('report', templateData);