DEV Community

Cover image for ActionMailer Balancer: Keeping the Email Sending Equilibrium
Liza
Liza

Posted on

ActionMailer Balancer: Keeping the Email Sending Equilibrium

Can your sending reputation and domain authority switch Email Service Providers (ESPs) together with you? Will the migration from the SMTP to the API affect your email deliverability? How to keep up with your usual sending volumes without a drop? How to mitigate sending risks and be able to deliver those VERY IMPORTANT emails to your customers’ inboxes no matter what?

Now, Mailtrap has developed the answer to all these questions for Ruby applications: the ActionMailer Balancer.

What is the ActionMailer Balancer?

Mailtrap ActionMailer Balancer is an ActionMailer extension that works, well, surprise, as a balancer! It allows proportionally distributing the email sending load between two different sending services and keeping the sending equilibrium in the percentage you need and set up for yourself. For example:

SendGrid 70% / Mailtrap 30%.

or

Postmark 60% / Mailgun 40%.

The Balancer works with any valid ActionMailer delivery method, either built-in, or added from the library, like the one from Mailtrap.

How ActionMailer Balancer works

After you install the Balancer to your application, and do some minor configurations, it will extend the sending method of ActionMailer.

The uniqueness of the gem is that for both sending services (whichever you choose), ActionMailer Balancer decides what sending solution to use even before ActionMailer is called.

Let’s say you use SendGrid as your major email sending solution, and then you decide to migrate to Mailtrap for any reason possible (legal, financial, server location etc). You can’t (actually you can, but better not do that by all means) migrate just in one step since your emails sent with the new ESP, Mailtrap in this particular case, would be recognized as spam. Thus, you need to move slowly, step by step, increasing the volume of emails you send from Mailtrap. This is where the ActionMailer Balancer gem comes into play.

For a step-by-step guide on how to start using the ActionMailer Balancer check out the article.

And for more detailed info on the boilerplate and use in development, check out the Mailtrap ActionMailer Balancer Github page.

Top comments (0)