diff --git a/hermes/queues/send-admin-active-community-report-email.js b/hermes/queues/send-admin-active-community-report-email.js index 6a7a5ac19f..c892f9ae88 100644 --- a/hermes/queues/send-admin-active-community-report-email.js +++ b/hermes/queues/send-admin-active-community-report-email.js @@ -44,8 +44,8 @@ export default (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-admin-community-created-email.js b/hermes/queues/send-admin-community-created-email.js index 4cd6b4cbd4..f1c334c812 100644 --- a/hermes/queues/send-admin-community-created-email.js +++ b/hermes/queues/send-admin-community-created-email.js @@ -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); } }; diff --git a/hermes/queues/send-admin-slack-import-email.js b/hermes/queues/send-admin-slack-import-email.js index 06ec54a139..0aff465fc5 100644 --- a/hermes/queues/send-admin-slack-import-email.js +++ b/hermes/queues/send-admin-slack-import-email.js @@ -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); } }; diff --git a/hermes/queues/send-admin-toxic-content-email.js b/hermes/queues/send-admin-toxic-content-email.js index 3947f7ddb6..96186a725d 100644 --- a/hermes/queues/send-admin-toxic-content-email.js +++ b/hermes/queues/send-admin-toxic-content-email.js @@ -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); } }; diff --git a/hermes/queues/send-admin-user-reported-email.js b/hermes/queues/send-admin-user-reported-email.js index 3b6b96252d..b868f83746 100644 --- a/hermes/queues/send-admin-user-reported-email.js +++ b/hermes/queues/send-admin-user-reported-email.js @@ -34,8 +34,8 @@ export default async (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-admin-user-spamming-threads-notification-email.js b/hermes/queues/send-admin-user-spamming-threads-notification-email.js index 16dbae5806..e92adb951f 100644 --- a/hermes/queues/send-admin-user-spamming-threads-notification-email.js +++ b/hermes/queues/send-admin-user-spamming-threads-notification-email.js @@ -50,8 +50,8 @@ export default (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-administrator-email-validation-email.js b/hermes/queues/send-administrator-email-validation-email.js index c0757bd8d1..b542e25462 100644 --- a/hermes/queues/send-administrator-email-validation-email.js +++ b/hermes/queues/send-administrator-email-validation-email.js @@ -53,8 +53,8 @@ export default async (job: Job) => { userId, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } } diff --git a/hermes/queues/send-community-invite-email.js b/hermes/queues/send-community-invite-email.js index 43b75e5265..288c7d193f 100644 --- a/hermes/queues/send-community-invite-email.js +++ b/hermes/queues/send-community-invite-email.js @@ -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); } }; diff --git a/hermes/queues/send-digest-email.js b/hermes/queues/send-digest-email.js index 6a2872f164..7f8bf5c1ca 100644 --- a/hermes/queues/send-digest-email.js +++ b/hermes/queues/send-digest-email.js @@ -82,8 +82,8 @@ export default async (job: Job) => { userId, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-email-validation-email.js b/hermes/queues/send-email-validation-email.js index 444c82876b..d05fd6eaf5 100644 --- a/hermes/queues/send-email-validation-email.js +++ b/hermes/queues/send-email-validation-email.js @@ -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); } } diff --git a/hermes/queues/send-mention-message-email.js b/hermes/queues/send-mention-message-email.js index 43c5fd3553..cd52ba680e 100644 --- a/hermes/queues/send-mention-message-email.js +++ b/hermes/queues/send-mention-message-email.js @@ -50,8 +50,8 @@ export default async (job: Job) => { userId: recipient.id, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-mention-thread-email.js b/hermes/queues/send-mention-thread-email.js index 89e538e83b..0dc5e9ffb1 100644 --- a/hermes/queues/send-mention-thread-email.js +++ b/hermes/queues/send-mention-thread-email.js @@ -43,8 +43,8 @@ export default async (job: Job) => { userId: recipient.id, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-new-community-welcome-email.js b/hermes/queues/send-new-community-welcome-email.js index 0a29d2737b..88fd411811 100644 --- a/hermes/queues/send-new-community-welcome-email.js +++ b/hermes/queues/send-new-community-welcome-email.js @@ -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); } }; diff --git a/hermes/queues/send-new-direct-message-email.js b/hermes/queues/send-new-direct-message-email.js index 8bc09cfa6c..b7612a0f2d 100644 --- a/hermes/queues/send-new-direct-message-email.js +++ b/hermes/queues/send-new-direct-message-email.js @@ -45,8 +45,8 @@ export default async (job: Job) => { userId: recipient.userId, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-new-message-email.js b/hermes/queues/send-new-message-email.js index 517ced30c4..558c109c9f 100644 --- a/hermes/queues/send-new-message-email.js +++ b/hermes/queues/send-new-message-email.js @@ -102,8 +102,8 @@ export default async (job: Job) => { userId: recipient.userId, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-new-thread-email.js b/hermes/queues/send-new-thread-email.js index fff1a6a640..e48e281b60 100644 --- a/hermes/queues/send-new-thread-email.js +++ b/hermes/queues/send-new-thread-email.js @@ -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); } }; diff --git a/hermes/queues/send-private-channel-request-approved-email.js b/hermes/queues/send-private-channel-request-approved-email.js index f669a8217d..98fcbfb7aa 100644 --- a/hermes/queues/send-private-channel-request-approved-email.js +++ b/hermes/queues/send-private-channel-request-approved-email.js @@ -40,8 +40,8 @@ export default (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-private-channel-request-sent-email.js b/hermes/queues/send-private-channel-request-sent-email.js index 3aa99f943b..b0923bef80 100644 --- a/hermes/queues/send-private-channel-request-sent-email.js +++ b/hermes/queues/send-private-channel-request-sent-email.js @@ -40,8 +40,8 @@ export default (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-private-community-request-approved-email.js b/hermes/queues/send-private-community-request-approved-email.js index 31a931163d..b5e3f74c32 100644 --- a/hermes/queues/send-private-community-request-approved-email.js +++ b/hermes/queues/send-private-community-request-approved-email.js @@ -39,8 +39,8 @@ export default (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-private-community-request-sent-email.js b/hermes/queues/send-private-community-request-sent-email.js index 36d4444015..c551923515 100644 --- a/hermes/queues/send-private-community-request-sent-email.js +++ b/hermes/queues/send-private-community-request-sent-email.js @@ -41,8 +41,8 @@ export default (job: Job) => { }, }); } catch (err) { - debug('❌ Error in job:\n'); - debug(err); + console.error('❌ Error in job:\n'); + console.error(err); Raven.captureException(err); } }; diff --git a/hermes/queues/send-user-welcome-email.js b/hermes/queues/send-user-welcome-email.js index 52c567cfc8..5405da328e 100644 --- a/hermes/queues/send-user-welcome-email.js +++ b/hermes/queues/send-user-welcome-email.js @@ -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); } }; diff --git a/hermes/queues/sendgrid-webhook-events.js b/hermes/queues/sendgrid-webhook-events.js index 071a000fb6..8da048cfcf 100644 --- a/hermes/queues/sendgrid-webhook-events.js +++ b/hermes/queues/sendgrid-webhook-events.js @@ -25,8 +25,8 @@ export default (job: Job) => { 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); } }; diff --git a/hermes/send-email.js b/hermes/send-email.js index 580df27e1f..a14d441feb 100644 --- a/hermes/send-email.js +++ b/hermes/send-email.js @@ -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, + }); }); };