Skip to content

Commit

Permalink
Renamed sendNotification to sendWelcomeMail
Browse files Browse the repository at this point in the history
- The only thing the method does now is sending welcome mail, so new naming seems natural :)
  • Loading branch information
naz committed Jul 30, 2019
1 parent 8503bdc commit c7a836b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion core/server/api/v0.1/authentication.js
Expand Up @@ -290,7 +290,8 @@ authentication = {
}

function sendNotification(setupUser) {
return auth.setup.sendNotification(setupUser, mailAPI);
return auth.setup.sendWelcomeEmail(setupUser.email, mailAPI)
.then(() => setupUser);
}

function formatResponse(setupUser) {
Expand Down
3 changes: 1 addition & 2 deletions core/server/api/v2/authentication.js
Expand Up @@ -34,8 +34,7 @@ module.exports = {
return auth.setup.doSettings(data, api.settings);
})
.then((user) => {
const notificationUser = user.toJSON({context: {internal: true}});
return auth.setup.sendNotification(notificationUser, api.mail)
return auth.setup.sendWelcomeEmail(user.get('email'), api.mail)
.then(() => user);
});
}
Expand Down
4 changes: 2 additions & 2 deletions core/server/services/auth/setup.js
Expand Up @@ -82,7 +82,7 @@ async function doSettings(data, settingsAPI) {
return user;
}

function sendNotification(email, mailAPI) {
function sendWelcomeEmail(email, mailAPI) {
if (config.get('sendWelcomeEmail')) {
const data = {
ownerEmail: email
Expand Down Expand Up @@ -117,5 +117,5 @@ module.exports = {
assertSetupCompleted: assertSetupCompleted,
setupUser: setupUser,
doSettings: doSettings,
sendNotification: sendNotification
sendWelcomeEmail: sendWelcomeEmail
};

0 comments on commit c7a836b

Please sign in to comment.