2
6 Comments

How do you automatically send emails to your users?

Hey devs,

Yesterday I wrote this post about automating emails based on user behaviour.

Automated Emails

We use cloud functions that a client can ping whenever they like to trigger an email sending function. It's working really well for us, however, this may not be the best solution and I was curious as to what other tech people are using to automatically send emails?

on March 12, 2021
  1. 1

    Setup a message queue, post emails you need to send to the queue, then implement a scheduler that periodically reads the queue and sends the emails.

    That way you gain fault tolerance, so any node can be restarted without loosing emails and you also separate the website from the backend processing.

    There are cloud queues like AWS SQS (good for very high volume) but you can host your own too, for instance RabbitMQ, I’ve also had good results with MongoDB backed queues for smaller loads.

    1. 1

      Sounds very organised and efficient, I like it (plus I'm a Brit and apparently we like queuing 😄). Ah of course - I forgot about SQS, though I have come across it before. May not be reaching very high volume any time soon but I now understand why queueing could be very useful in the future, thanks!

      1. 2

        Fellow Brit here.

        Yeah that’s what they say, for me I can think of times when queues stressed me out no end, and some other queue based situations where I was very chill and sort of ‘enjoyed’ the experience :)

        I don’t know what backend language you are using, or what your architecture looks like, but you might find some relevant info in a blog post I wrote:

        Robust NodeJS Deployment Architecture

        That’s the angle my advice was coming from.

  2. 1

    My own product does this...the whole point is a separate integrated system. As coders, we want to build everything ourselves...but there is a point of fast negative returns.

    1. 1

      Interesting, what's the name of your product I'd love to check it out!