Skip to content

prosapient/bamboo_fallback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bamboo.FallbackAdapter

An adapter for the Bamboo email app. Allows you to compose multiple adapters to increase the guarantee of delivering. It applies adapters one by one and fails only when all adapters fail.

Installation

The package can be installed by adding bamboo_fallback to your list of dependencies in mix.exs:

def deps do
  [
    {:bamboo_fallback, "~> 2.0"}
  ]
end

Config

config :myapp, MyApp.Mailer,
  adapter: Bamboo.FallbackAdapter,
  fallback_options: [
    {Bamboo.SendGridAdapter, api_key: "SENDGRID_API_KEY"},
    {Bamboo.MailgunAdapter, api_key: "MAILGUN_API_KEY", domain: "MAILGUN_DOMAIN"}
  ]

This example uses SendGridAdapter as a primary adapter and MailgunAdapter as a secondary one. You can use as many adapters as you want.