Skip to content

Commit a2fabfe

Browse files
authored
overrode email template to send declined emails to hackers with applied status (#972)
1 parent f996bf1 commit a2fabfe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

services/automatedEmails.service.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ class AutomatedEmailService {
4343
);
4444
}
4545

46+
// Override: send Declined emails to Applied hackers
47+
const emailStatus = status === "Applied" ? "Declined" : status;
48+
4649
const emailPromises = hackers.map(async (hacker) => {
4750
try {
4851
await new Promise((resolve, reject) => {
4952
Services.Email.sendStatusUpdate(
5053
hacker.accountId.firstName,
5154
hacker.accountId.email,
52-
status,
55+
emailStatus,
5356
(err) => {
5457
if (err) {
5558
reject(err);
@@ -62,7 +65,7 @@ class AutomatedEmailService {
6265
results.success++;
6366
} catch (err) {
6467
Services.Logger.error(
65-
`${TAG} Failed to send ${status} email to ${hacker.accountId.email}: ${err}`,
68+
`${TAG} Failed to send ${emailStatus} email to ${hacker.accountId.email}: ${err}`,
6669
);
6770
results.failed++;
6871
}

0 commit comments

Comments
 (0)