Skip to content

Instantly share code, notes, and snippets.

@aloukissas
Last active July 25, 2019 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aloukissas/8c6aed12b956ff40a453b98c30725ba6 to your computer and use it in GitHub Desktop.
Save aloukissas/8c6aed12b956ff40a453b98c30725ba6 to your computer and use it in GitHub Desktop.
defmodule Acme.Tasks.Email do
import Bamboo.Email
alias Acme.Models.User
def welcome_user(%User{first_name: first_name, email: email, state: "ACTIVE"})
when first_name != "" do
new_email(
to: {first_name, email},
from: {"Acme Products", "hello@acme.com"},
subject: "Welcome to Acme Products",
text_body: """
Hey #{first_name},
Welcome to Acme Products! We offer the best coyote-catching contraptions in the market.
Beep beep,
Acme Products
"""
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment