Skip to content

Commit 8503bdc

Browse files
committed
Refactored sendNotification method to just use email address as parameter
1 parent 36026ab commit 8503bdc

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

core/server/services/auth/setup.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ async function doSettings(data, settingsAPI) {
8282
return user;
8383
}
8484

85-
function sendNotification(setupUser, mailAPI) {
86-
const data = {
87-
ownerEmail: setupUser.email
88-
};
89-
85+
function sendNotification(email, mailAPI) {
9086
if (config.get('sendWelcomeEmail')) {
87+
const data = {
88+
ownerEmail: email
89+
};
90+
9191
return mail.utils.generateContent({data: data, template: 'welcome'})
9292
.then((content) => {
9393
const message = {
94-
to: setupUser.email,
94+
to: email,
9595
subject: common.i18n.t('common.api.authentication.mail.yourNewGhostBlog'),
9696
html: content.html,
9797
text: content.text
@@ -108,11 +108,8 @@ function sendNotification(setupUser, mailAPI) {
108108
err.context = common.i18n.t('errors.api.authentication.unableToSendWelcomeEmail');
109109
common.logging.error(err);
110110
});
111-
})
112-
.return(setupUser);
111+
});
113112
}
114-
115-
return setupUser;
116113
}
117114

118115
module.exports = {

0 commit comments

Comments
 (0)