woohaaha

woohaaha

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

Most Liked

nikody

nikody

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.

tomciopp

tomciopp

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.

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Other popular topics Top

SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement