Fixes: Collection creation notification email
Added: Unsubscribe option to notification email footers Added: Two new notification types (emails not written yet) Fixed: Validation added to notification setting events
This commit is contained in:
@ -133,16 +133,24 @@ User.beforeCreate(setRandomJwtSecret);
|
||||
User.afterCreate(user => sendEmail('welcome', user.email));
|
||||
|
||||
// By default when a user signs up we subscribe them to email notifications
|
||||
// when documents they created are edited by other team members.
|
||||
User.afterCreate((user, options) =>
|
||||
NotificationSetting.findOrCreate({
|
||||
// when documents they created are edited by other team members and onboarding
|
||||
User.afterCreate(async (user, options) => {
|
||||
await NotificationSetting.findOrCreate({
|
||||
where: {
|
||||
userId: user.id,
|
||||
teamId: user.teamId,
|
||||
event: 'documents.update',
|
||||
},
|
||||
transaction: options.transaction,
|
||||
})
|
||||
);
|
||||
});
|
||||
await NotificationSetting.findOrCreate({
|
||||
where: {
|
||||
userId: user.id,
|
||||
teamId: user.teamId,
|
||||
event: 'emails.onboarding',
|
||||
},
|
||||
transaction: options.transaction,
|
||||
});
|
||||
});
|
||||
|
||||
export default User;
|
||||
|
Reference in New Issue
Block a user