Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hermes/queues/send-admin-active-community-report-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default (job: Job<AdminActiveCommunityReportJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-admin-community-created-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default job => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-admin-slack-import-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default job => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-admin-toxic-content-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default job => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-admin-user-reported-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export default async (job: Job<AdminProcessUserReportedJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default (job: Job<AdminUserSpammingThreadsJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-administrator-email-validation-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default async (job: Job<AdministratorEmailValidationEmailJobData>) => {
userId,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
}
Expand Down
4 changes: 2 additions & 2 deletions hermes/queues/send-community-invite-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export default (job: SendCommunityInviteEmailJob) => {
userId: recipient.userId,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-digest-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export default async (job: Job<SendDigestEmailJobData>) => {
userId,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-email-validation-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default async (job: SendEmailValidationJob) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
}
Expand Down
4 changes: 2 additions & 2 deletions hermes/queues/send-mention-message-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default async (job: Job<SendNewMessageMentionEmailJobData>) => {
userId: recipient.id,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-mention-thread-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default async (job: Job<SendNewMessageMentionEmailJobData>) => {
userId: recipient.id,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-new-community-welcome-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default job => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-new-direct-message-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export default async (job: Job<SendNewDirectMessageEmailJobData>) => {
userId: recipient.userId,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-new-message-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export default async (job: Job<SendNewMessageEmailJobData>) => {
userId: recipient.userId,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-new-thread-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export default async (job: SendNewThreadEmailJob) => {
userId: recipient.id,
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-private-channel-request-approved-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default (job: Job<SendPrivateChannelRequestApprovedEmailJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-private-channel-request-sent-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export default (job: Job<SendPrivateChannelRequestEmailJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export default (job: Job<SendPrivateCommunityRequestApprovedEmailJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-private-community-request-sent-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default (job: Job<SendPrivateCommunityRequestEmailJobData>) => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/send-user-welcome-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default job => {
},
});
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
4 changes: 2 additions & 2 deletions hermes/queues/sendgrid-webhook-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default (job: Job<SendGridWebhookEventJobData>) => {
debug('Processing SendGrid webhook event');
return processEvent(job);
} catch (err) {
debug('❌ Error in job:\n');
debug(err);
console.error('❌ Error in job:\n');
console.error(err);
Raven.captureException(err);
}
};
24 changes: 6 additions & 18 deletions hermes/send-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,12 @@ const sendEmail = (options: Options) => {

// $FlowFixMe
return new Promise((res, rej) => {
sg.send(
{
...defaultOptions,
templateId,
to,
dynamic_template_data,
},
async (res, err) => {
if (err) {
console.error('Error sending email:');
console.error(err);
return rej(err);
}

res();
debug(`email to ${to} sent successfully`);
}
);
sg.send({
...defaultOptions,
templateId,
to,
dynamic_template_data,
});
});
};

Expand Down