Last active
July 25, 2019 17:45
-
-
Save aloukissas/8c6aed12b956ff40a453b98c30725ba6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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