dwyl / sendemail

💌 Simplifies reliably sending emails from your node.js apps using AWS Simple Email Service (SES)
181 stars 26 forks source link

Testing of emails #43

Closed roryc89 closed 6 years ago

roryc89 commented 8 years ago

At the moment email tests are simply checking that the data being passes to sendemail module (which uses SES) is as we expect and that there is no error in the sending of the email. But we are not testing if emails bounce and if they appear to the recipient as they should do.

Is this level of testing sufficient and are there ways to test the appearance and bouncing of emails?

nelsonic commented 8 years ago

There are Two things we can do to ensure that email functionality is working:

  1. Setup an inbound email address we can use to check the contents of email we send.
  2. Setup a "Cron" (regularly executed) task to reconcile (check) the status of all emails we have sent and confirm if any bounced.
nelsonic commented 8 years ago

I recommend we use AWS Lambda for running the task of checking bounce rate. Example of setting up a Cron job using AWS Lambda: https://github.com/TheScienceMuseum/collectionsonline-sitemap

If you are new to AWS Lambda, check out: https://github.com/dwyl/learn-aws-lambda

nelsonic commented 7 years ago

Hi @roryc89! @shouston3 has kindly updated the API of this package to be easily testable. We will need to update our usage of it in OA. hopefully it's a small update. Please confirm this helps ... thanks! 👍

roryc89 commented 6 years ago

Thanks for the update @nelsonic. I believe the update in OA was made a while ago. I don't think the level of e2e testing mentioned in the description as we can rely upon SES. Do you think we're ok to close this?

nelsonic commented 6 years ago

@roryc89 yeah, let's close it and re-open if we need it. 👍