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:
Graham McIntire 2026-01-04 11:16:12 -06:00
parent 72c260e122
commit 9a721191fe
No known key found for this signature in database
3 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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)

View file

@ -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)