Amazon SES with Bamboo vs ExAws

Has anyone used both Bamboo and ExAws and can comment on the differences?

I would imagine that if I want to integrate with AWS SES than the obvious choice is ExAws even if both libraries (ExAws, Bamboo) are only using SMTP. My concern was that I believe ExAws was briefly deprecated while searching for a new maintainer while Thoughtbot has a great track record for maintaining libraries.

So:

  1. If you have used both or either libraries to send emails from SES I’d like to know your experience and preferences?

  2. Am I missing something in my rationale?

Thank you

1 Like

I have used AWS SES directly with ExAws and the reasons for this choice were mainly that we wanted to avoid additional dependencies - in this case Bamboo, but also its SES adapter. With Bamboo, you have to use different adapters, which are a separate dependency and vary depending on the email delivery service you use.

If you take a look at the code for the SES adapter for Bamboo, you’ll notice it also uses ExAws underneath. Also, there is a notice in the readme for ExAws that it is once more actively maintained, and I haven’t noticed or heard of any problems with it, so I believe it should be fine.

Now, Bamboo’s plus is that it hides a tiny bit of the complexity when composing the emails and if you use just ExAws you should be careful to compose them correctly. Mostly, be careful about the newlines as in some cases two of them are required. For reference, this is similar to what I last used:

"From: #{sender_email}\n" <>
"Return-Path: #{return_path}\n" <>
"To: #{user_email}\n" <>
"Subject: #{subject}\n" <>
"MIME-Version: 1.0\n" <>
"Content-type: #{content_type};charset=UTF-8\n\n" <>
 body

Then you just pipe it to:

 |> ExAws.SES.send_raw_email()
 |> ExAws.request(region: aws_region) # SES is not available in some regions so you might have to use a different one to your standard region

However, another plus in Bamboo’s favour is that it allows for easier testing. The Bamboo.Interceptor behaviour also seems pretty nice. And the Bamboo.SentEmailViewerPlug plug makes it easy to view emails in development.

Ultimately, I believe it depends on if you want these additional features that Bamboo offers or if you prefer to have fewer dependencies.

3 Likes

We use Bamboo and ExAWS in our project, but don’t use ExAWS to integrate with SES. We use the bamboo_smtp adapter for that. This choice was made before ex_aws_ses and an ses adapter for bamboo existed. Testing and configuration for this setup is fairly easy (we set some ENV variables at runtime) and we haven’t noticed any problems with delivery or long term maintenance.

That being said, I would probably use the bamboo_ses adapter if I were coming into a greenfield project. Since it just wraps ex_aws_ses it likely solves all the problems you would have to go through yourself.

2 Likes