bamboo v1.3.0 Bamboo.MailgunHelper View Source

Functions for using features specific to Mailgun (e.g. tagging, templates).

Link to this section Summary

Functions

This behaves like Bamboo.MailgunHelper.substitute_variables/3, but accepts a Map rather than a key, value pair.

When sending an email with Bamboo.MailgunHelper.template/2 you can replace a handlebars variables using this function.

Add a tag to outgoing email to help categorize traffic based on some criteria, perhaps separate signup emails from password recovery emails or from user comments.

Send an email using a template stored in Mailgun, rather than supplying a Bamboo.Email.text_body/2 or a Bamboo.Email.html_body/2.

Link to this section Functions

Link to this function

substitute_variables(email, variables) View Source

This behaves like Bamboo.MailgunHelper.substitute_variables/3, but accepts a Map rather than a key, value pair.

Example

email
|> MailgunHelper.template("password-reset-email")
|> MailgunHelper.substitute_variables(%{ "greeting" => "Hello!", "password_reset_link" => "https://example.com/123" })
Link to this function

substitute_variables(email, key, value) View Source

When sending an email with Bamboo.MailgunHelper.template/2 you can replace a handlebars variables using this function.

More details about templates can be found in the Templates section of the Mailgun documentation.

Example

email
|> MailgunHelper.template("password-reset-email")
|> MailgunHelper.substitute_variables("password_reset_link", "https://example.com/123")

Add a tag to outgoing email to help categorize traffic based on some criteria, perhaps separate signup emails from password recovery emails or from user comments.

More details can be found in the Mailgun documentation

Example

email
|> MailgunHelper.tag("welcome-email")
Link to this function

template(email, template_name) View Source

Send an email using a template stored in Mailgun, rather than supplying a Bamboo.Email.text_body/2 or a Bamboo.Email.html_body/2.

More details about templates can be found in the Templates section of the Mailgun documentation.