diff --git a/server/models/User.js b/server/models/User.js index 3df4f788a..94a4ffa7b 100644 --- a/server/models/User.js +++ b/server/models/User.js @@ -238,13 +238,7 @@ User.beforeSave(uploadAvatar); User.beforeCreate(setRandomJwtSecret); User.afterCreate(async (user) => { const team = await Team.findByPk(user.teamId); - - // 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 (user.service && user.service !== "slack") { - sendEmail("welcome", user.email, { teamUrl: team.url }); - } + sendEmail("welcome", user.email, { teamUrl: team.url }); }); // By default when a user signs up we subscribe them to email notifications @@ -267,6 +261,14 @@ User.afterCreate(async (user, options) => { }, transaction: options.transaction, }), + NotificationSetting.findOrCreate({ + where: { + userId: user.id, + teamId: user.teamId, + event: "emails.features", + }, + transaction: options.transaction, + }), ]); });