Set default email sender to hi@towerops.net
Configure mailer_from in runtime config and update UserNotifier and AlertNotifier to use the configured from address.
This commit is contained in:
parent
72c260e122
commit
9a721191fe
3 changed files with 9 additions and 2 deletions
|
|
@ -134,4 +134,7 @@ if config_env() == :prod do
|
|||
secret_key_base: secret_key_base
|
||||
|
||||
config :towerops, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
|
||||
|
||||
# Set default sender for all emails
|
||||
config :towerops, :mailer_from, {"Towerops", "hi@towerops.net"}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@ defmodule Towerops.Accounts.UserNotifier do
|
|||
|
||||
# Delivers the email using the application mailer.
|
||||
defp deliver(recipient, subject, body) do
|
||||
from_address = Application.get_env(:towerops, :mailer_from, {"Towerops", "hi@towerops.net"})
|
||||
|
||||
email =
|
||||
new()
|
||||
|> to(recipient)
|
||||
|> from({"Towerops", "contact@example.com"})
|
||||
|> from(from_address)
|
||||
|> subject(subject)
|
||||
|> text_body(body)
|
||||
|
||||
|
|
|
|||
|
|
@ -90,10 +90,12 @@ defmodule Towerops.Alerts.AlertNotifier do
|
|||
end
|
||||
|
||||
defp deliver(recipient, subject, body) do
|
||||
from_address = Application.get_env(:towerops, :mailer_from, {"Towerops", "hi@towerops.net"})
|
||||
|
||||
email =
|
||||
new()
|
||||
|> to(recipient)
|
||||
|> from({"TowerOps Alerts", "alerts@towerops.example.com"})
|
||||
|> from(from_address)
|
||||
|> subject(subject)
|
||||
|> text_body(body)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue