1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-09 23:45:31 +02:00

Merge pull request #19 from ranshamay/mail-fixes2

filter mass mails
This commit is contained in:
Ran Shamay 2023-11-22 13:13:41 +02:00 committed by GitHub
commit 4110a5e3ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -79,7 +79,7 @@ module.exports = {
request: this.req,
})
.intercept('userAlreadyCardMember', () => Errors.USER_ALREADY_CARD_MEMBER);
await sendUserEmails({ to: [inputs.userId], subject: 'b', text: 'c' });
await sendUserEmails({ to: [inputs.userId], subject: 'משימה חדשה ניתנה', text: 'c' });
return {
item: cardMembership,
};

View file

@ -28,8 +28,8 @@ const sendEmail = async ({ to, subject, text, cc }) => {
}
};
const sendUserEmails = async ({ ids, subject, text, cc }) => {
const users = await sails.helpers.users.getMany(ids);
const sendUserEmails = async ({ to, subject, text, cc }) => {
const users = await sails.helpers.users.getMany({ id: { in: to } });
return sendEmail({ to: users.map((u) => u.email), subject, text, cc });
};