Bamboo SparkPost Adapter v2.0.0 Bamboo.SparkPostHelper View Source

Functions for using features specific to SparkPost e.g. tagging

Link to this section Summary

Functions

Disable click tracking

Disable open tracking (SparkPost defaults to true)

Enables the inline CSS option

Mark an email as transactional

Add meta data to an email

Put extra message parameters that are used by SparkPost

Set a single tag or multiple tags for an email.

Link to this section Functions

Link to this function

disable_click_tracking(email)

View Source

Disable click tracking

Example

email |> disable_click_tracking
Link to this function

disable_open_tracking(email)

View Source

Disable open tracking (SparkPost defaults to true)

Example

email |> disable_open_tracking

Enables the inline CSS option

Example

email |> inline_css
Link to this function

mark_transactional(email)

View Source

Mark an email as transactional

Example

email |> mark_transactional

Add meta data to an email

Example

email
|> meta_data(foo: bar)
|> meta_data(%{bar: "baz")
Link to this function

put_param(email, keys, value)

View Source

Put extra message parameters that are used by SparkPost

Parameters set with this function are sent to SparkPost when used along with the Bamboo.SparkPostAdapter. You can set any additional parameters that the SparkPost API supports Other functions in this module provide a more convenient way of setting these parameters.

Example

email
|> put_param([:options, :open_tracking], false)
|> put_param(:tags, ["foo", "bar"])
|> put_param(:meta_data, %{foo: "bar"})

Set a single tag or multiple tags for an email.

Example

tag(email, "welcome-email")
tag(email, ["welcome-email", "marketing"])