mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Refactored sendNotification method to just use email address as parameter
This commit is contained in:
parent
36026ab929
commit
8503bdceb8
@ -82,16 +82,16 @@ async function doSettings(data, settingsAPI) {
|
||||
return user;
|
||||
}
|
||||
|
||||
function sendNotification(setupUser, mailAPI) {
|
||||
function sendNotification(email, mailAPI) {
|
||||
if (config.get('sendWelcomeEmail')) {
|
||||
const data = {
|
||||
ownerEmail: setupUser.email
|
||||
ownerEmail: email
|
||||
};
|
||||
|
||||
if (config.get('sendWelcomeEmail')) {
|
||||
return mail.utils.generateContent({data: data, template: 'welcome'})
|
||||
.then((content) => {
|
||||
const message = {
|
||||
to: setupUser.email,
|
||||
to: email,
|
||||
subject: common.i18n.t('common.api.authentication.mail.yourNewGhostBlog'),
|
||||
html: content.html,
|
||||
text: content.text
|
||||
@ -108,11 +108,8 @@ function sendNotification(setupUser, mailAPI) {
|
||||
err.context = common.i18n.t('errors.api.authentication.unableToSendWelcomeEmail');
|
||||
common.logging.error(err);
|
||||
});
|
||||
})
|
||||
.return(setupUser);
|
||||
});
|
||||
}
|
||||
|
||||
return setupUser;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
Loading…
Reference in New Issue
Block a user