2021-03-05 19:23:32 -05:00
|
|
|
defmodule Shift73k.Mailer.UserEmail do
|
2022-08-13 06:39:14 -04:00
|
|
|
import Swoosh.Email
|
2023-01-28 08:14:32 -05:00
|
|
|
import Shift73k, only: [get_app_mailer_from: 0, get_app_mailer_reply_to: 0]
|
2021-02-24 15:52:42 -05:00
|
|
|
|
|
|
|
|
2022-08-13 06:39:14 -04:00
|
|
|
def compose(user_email, subject, body_text) do
|
|
|
|
new()
|
2023-01-28 08:14:32 -05:00
|
|
|
|> from(get_app_mailer_from())
|
2022-08-13 06:39:14 -04:00
|
|
|
|> to(user_email)
|
2023-01-28 08:14:32 -05:00
|
|
|
|> header("Reply-To", get_app_mailer_reply_to())
|
2021-02-24 15:52:42 -05:00
|
|
|
|> subject(subject)
|
|
|
|
|> text_body(body_text)
|
|
|
|
end
|
|
|
|
end
|