Mailcast.Swoosh.Helper (mailcast v0.0.7)

Copy Markdown View Source

Helper functions for Swoosh emails using the Mailcast adapter.

Summary

Functions

Add a tag to the email.

Disable click tracking for the email.

Disable open tracking for the email.

Enable click tracking for the email.

Enable open tracking for the email.

Add to the data for the email.

Set the data for the email. Data is used for variable substitution in the template language.

Set the tags for the email.

Set the template ID for the email.

Set the transactional flag for the email.

Functions

add_tag(email, name, value)

Add a tag to the email.

Examples

email
|> Mailcast.Swoosh.Helper.add_tag("tag1", "value1")

disable_click_tracking(email)

Disable click tracking for the email.

Examples

email
|> Mailcast.Swoosh.Helper.disable_click_tracking()

disable_open_tracking(email)

Disable open tracking for the email.

Examples

email
|> Mailcast.Swoosh.Helper.disable_open_tracking()

enable_click_tracking(email)

Enable click tracking for the email.

Examples

email
|> Mailcast.Swoosh.Helper.enable_click_tracking()

enable_open_tracking(email)

Enable open tracking for the email.

Examples

email
|> Mailcast.Swoosh.Helper.enable_open_tracking()

put_data(email, key, value)

Add to the data for the email.

Examples

email
|> Mailcast.Swoosh.Helper.put_data("first_name", "John")

set_data(email, data)

Set the data for the email. Data is used for variable substitution in the template language.

This will replace the existing data.

Examples

email
|> Mailcast.Swoosh.Helper.set_data(%{"first_name" => "John", "last_name" => "Doe"})

set_tags(email, tags)

Set the tags for the email.

This will replace the existing tags.

Examples

email
|> Mailcast.Swoosh.Helper.set_tags([%{name: "tag1", value: "value1"}])

set_template_id(email, template_id)

Set the template ID for the email.

Examples

email
|> Mailcast.Swoosh.Helper.set_template_id("template_01jzqtmznaexgb9d3rpectx870")

set_transactional(email)

Set the transactional flag for the email.

Examples

email
|> Mailcast.Swoosh.Helper.set_transactional()

validate_tags(tags)