0

I'm using the heroku SendGrid addon to send reminder emails on a schedule defined via heroku scheduler addon.

I want to do some live tests to make sure the heroku scheduler is configured correctly and the emails really send.

The problem is I have an app with a lot of dummy data. E.g. emails like something_random_ldskfj@example.com or just sldkfjsldfjsldkfj@example.com. I'm worried those emails sent will either go unread, bounce, or something else that SendGrid (or any mailing service) would consider 'negative', and that will mark my account as suspicious.

Question

How can I live test my app with heroku scheduler and make sure emails really send at the right times, without incurring the wrath of upsetting the mailing service?

What I've thought about doing

  • Setting up a lot of test gmail accounts - one for each dummy user (undesirable)
  • Sending to random emails like sldfjsd@example.com and not worrying about the potential consequences (very bad idea)
  • Setting up all the dummy accounts in my app with my own, personal email (cannot be done since the database enforces uniqueness of email)
  • Use some email addresses Heroku or SendGrid specifically provided for exactly this purpose? (sounds good if it exists?)
  • Altering all my test data so that the conditions for emails being sent will never met, except for a very small few (it would work, but it would require changing all the test data and therefore change the look and feel of the app)
stevec
  • 41,291
  • 27
  • 223
  • 311
  • I just stumbled across https://devcenter.heroku.com/articles/mailtrap I will update once I've tried it – stevec Jan 23 '21 at 15:11

1 Answers1

0

After discussing with people more experienced than me, the advice I received was

  • If it's possible to send the emails only to yourself, then do that (not possible in my case)
  • No need to test heroku's scheduler (trust that it works)
  • Write really good tests to ensure the logic and code in your scheduled task works locally, and trust them - those test results mean it will work as expected in production
stevec
  • 41,291
  • 27
  • 223
  • 311