Skip to content

Commit f79f42b

Browse files
committed
fix recipients
1 parent 624cad5 commit f79f42b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/routes/copilotRequest/approveRequest.service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module.exports = (req, data, existingTransaction) => {
6868
const copilotPortalUrl = config.get('copilotPortalUrl');
6969
req.log.info("Sending emails to all copilots about new opportunity");
7070

71-
const sendNotification = (userName, recipients) => createEvent(emailEventType, {
71+
const sendNotification = (userName, recipient) => createEvent(emailEventType, {
7272
data: {
7373
user_name: userName,
7474
opportunity_details_url: `${copilotPortalUrl}/opportunity/${opportunity.id}`,
@@ -78,14 +78,14 @@ module.exports = (req, data, existingTransaction) => {
7878
start_date: moment.utc(startDate).format("YYYY-MM-DD HH:mm:ss [UTC]"),
7979
},
8080
sendgrid_template_id: TEMPLATE_IDS.CREATE_REQUEST,
81-
recipients,
81+
recipients: [recipient],
8282
version: 'v3',
8383
}, req.log);
8484

8585
subjects.forEach(subject => sendNotification(subject.handle, subject.email));
8686

8787
// send email to notify via slack
88-
sendNotification('Copilots', [config.copilotsSlackEmail]);
88+
sendNotification('Copilots', config.copilotsSlackEmail);
8989

9090
req.log.info("Finished sending emails to copilots");
9191

0 commit comments

Comments
 (0)