Bamboo.SparkPostAdapter
An Adapter for the Bamboo email app.
Installation
The package can be installed as:
- Add bamboo_sparkpost to your list of dependencies in
mix.exs
:
def deps do
[{:bamboo_sparkpost, "~> 1.0.0-rc.0"}]
end
- Ensure bamboo is started before your application:
def application do
[applications: [:bamboo]]
end
- Add your SparkPost API key to your config
# In your config/config.exs file
config :my_app, MyApp.Mailer,
adapter: Bamboo.SparkPostAdapter,
api_key: "my-api-key"
Follow Bamboo Getting Started Guide
Optionally add
hackney_options
section
# In your config/config.exs file
config :my_app, MyApp.Mailer,
adapter: Bamboo.SparkPostAdapter,
api_key: "my-api-key",
hackney_options: [
connect_timeout: 8_000,
recv_timeout: 5_000
]
Advanced Usage
The SparkPost adapter provides a helper module for setting tags and other meta data
Examples
include Bamboo.SparkPostHelper
email
|> tag("my-tag")
|> mark_transactional
|> disable_open_tracking
|> disable_click_tracking
|> meta_data(foo: "bar")