mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +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) {
|
||||
const data = {
|
||||
ownerEmail: setupUser.email
|
||||
};
|
||||
|
||||
function sendNotification(email, mailAPI) {
|
||||
if (config.get('sendWelcomeEmail')) {
|
||||
const data = {
|
||||
ownerEmail: email
|
||||
};
|
||||
|
||||
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