chore: Remove welcome email for Slack users (against TOS)

This commit is contained in:
Tom Moor 2019-06-25 20:28:45 -07:00
parent 8faed5de6f
commit 46ad1feb96
1 changed files with 7 additions and 1 deletions

View File

@ -160,7 +160,13 @@ User.beforeSave(uploadAvatar);
User.beforeCreate(setRandomJwtSecret);
User.afterCreate(async user => {
const team = await Team.findByPk(user.teamId);
sendEmail('welcome', user.email, { teamUrl: team.url });
// From Slack support:
// If you wish to contact users at an email address obtained through Slack,
// you need them to opt-in through a clear and separate process.
if (team.service !== 'slack') {
sendEmail('welcome', user.email, { teamUrl: team.url });
}
});
// By default when a user signs up we subscribe them to email notifications