Skip to content

Commit

Permalink
Update send-birthday-notification.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinhSE authored Jul 29, 2024
1 parent b893a6a commit 46f3ead
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export async function sendBirthdayNotification(
});
}
if(members.length > 1) {
let commaSeparatedIds = members.map(member => `<@${member.slackId}>`).join(', ');
const lastCommaIndex : number = commaSeparatedIds.lastIndexOf(',');
const result: string = commaSeparatedIds.substring(0, lastCommaIndex) + ' and' + commaSeparatedIds.substring(lastCommaIndex + 1);
job('notification.slack.send', {
channel: ENV.SLACK_BIRTHDAYS_CHANNEL_ID,
message: `Everyone wish a happy birthday to ${ result }! 🎉🎂🎈`,
workspace: 'regular',
});
}
let commaSeparatedIds = members.map(member => `<@${member.slackId}>`).join(', ');
const lastCommaIndex : number = commaSeparatedIds.lastIndexOf(',');
const result: string = commaSeparatedIds.substring(0, lastCommaIndex) + ' and' + commaSeparatedIds.substring(lastCommaIndex + 1);
job('notification.slack.send', {
channel: ENV.SLACK_BIRTHDAYS_CHANNEL_ID,
message: `Everyone wish a happy birthday to ${result}! 🎉🎂🎈`,
workspace: 'regular',
});
}

}

0 comments on commit 46f3ead

Please sign in to comment.