configure mail
This commit is contained in:
@@ -11,12 +11,18 @@ defmodule Firehose.Accounts.UserNotifier do
|
||||
alias Firehose.Accounts.User
|
||||
alias Firehose.Mailer
|
||||
|
||||
defp sender do
|
||||
name = System.get_env("SENDER_NAME") || "Firehose"
|
||||
email = System.get_env("SMTP_FROM_EMAIL") || "contact@example.com"
|
||||
{name, email}
|
||||
end
|
||||
|
||||
# Delivers the email using the application mailer.
|
||||
defp deliver(recipient, subject, body) do
|
||||
email =
|
||||
new()
|
||||
|> to(recipient)
|
||||
|> from({"Firehose", "contact@example.com"})
|
||||
|> from(sender())
|
||||
|> subject(subject)
|
||||
|> text_body(body)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user