An Adapter for the Bamboo email app. Uses SendInBlue API v2.0 or v3.0. The 2.0 version sunset date has been scheduled for June 25th 2021.
If available in Hex, the package can be installed as:
- Add bamboo_sendinblue to your list of dependencies in
mix.exs
:
def deps do
[{:bamboo_sendinblue, "~> 0.3.0"}]
end
- Ensure bamboo is started before your application:
def application do
[applications: [:bamboo]]
end
- Setup your SendinBlue configuration:
For API v2
# In your config/config.exs file (API v2)
config :my_app, MyApp.Mailer,
adapter: Bamboo.SendinBlueAdapter,
api_key: "your-api-V2-key"
For API v3
# In your config/config.exs file (API v3)
config :my_app, MyApp.Mailer,
adapter: Bamboo.SendinBlueAdapterV3,
api_key: "your-api-V3-key"
Please take note that V2 API keys will not work with the V3 adapter and vice versa. Refer to this page for more information.
- Follow Bamboo Getting Started Guide
import Bamboo.Email
new_email(
to: "[email protected]",
cc: [{"Foo", "[email protected]"}, {"Another Foo", "[email protected]"}],
bcc: [{"Hidden foo", "[email protected]"}],
attachments: [
Bamboo.Attachment.new("./test/support/attachment.png", filename: "attachment1.png"),
%Bamboo.Attachment{path: "<url>"}
]
)
|> put_header("reply-to-email", "[email protected]")
|> put_header("reply-to-name", "NoReply")
|> MyApp.Mailer.deliver_now()
Before opening a pull request you can open an issue if you have any question or need some guidance.
Here's how to setup the project:
$ git clone https://github.com/biospank/bamboo_sendinblue.git
$ cd bamboo_sendinblue
$ mix deps.get
$ mix test
Once you've made your additions and mix test
passes, go ahead and open a Pull Request.
Bamboo SendinBlueAdapter is released under The MIT License (MIT).