1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-09 07:25:24 +02:00

filter mass mails

This commit is contained in:
Ran Shamay 2023-11-22 13:12:57 +02:00
parent 6bfe13bb3d
commit b2c7371913
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 });
};