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

Ability to not send welcome email (#10293)

no issue

- We need to be able to not send the welcome email if needed
- Intruduces a new possible config setting `sendWelcomeEmail` which is set to `true` by default
This commit is contained in:
Aileen Nowak 2018-12-17 15:02:47 +01:00 committed by GitHub
parent aa8e75914d
commit 506d013f25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 22 deletions

View file

@ -531,28 +531,32 @@ authentication = {
common.events.emit('setup.completed', setupUser); common.events.emit('setup.completed', setupUser);
return mail.utils.generateContent({data: data, template: 'welcome'}) if (config.get('sendWelcomeEmail')) {
.then((content) => { return mail.utils.generateContent({data: data, template: 'welcome'})
const message = { .then((content) => {
to: setupUser.email, const message = {
subject: common.i18n.t('common.api.authentication.mail.yourNewGhostBlog'), to: setupUser.email,
html: content.html, subject: common.i18n.t('common.api.authentication.mail.yourNewGhostBlog'),
text: content.text html: content.html,
}, text: content.text
payload = { },
mail: [{ payload = {
message: message, mail: [{
options: {} message: message,
}] options: {}
}; }]
};
mailAPI.send(payload, {context: {internal: true}}) mailAPI.send(payload, {context: {internal: true}})
.catch((err) => { .catch((err) => {
err.context = common.i18n.t('errors.api.authentication.unableToSendWelcomeEmail'); err.context = common.i18n.t('errors.api.authentication.unableToSendWelcomeEmail');
common.logging.error(err); common.logging.error(err);
}); });
}) })
.return(setupUser); .return(setupUser);
}
return setupUser;
} }
function formatResponse(setupUser) { function formatResponse(setupUser) {

View file

@ -83,5 +83,6 @@
"resize": true "resize": true
}, },
"compress": true, "compress": true,
"preloadHeaders": false "preloadHeaders": false,
"sendWelcomeEmail": true
} }