prop/lib/microwaveprop/mailer.ex
Graham McIntire d6e9d80ce9 Send mail as prop@w5isp.com with reply-to graham@mcintire.me
Centralized the From and Reply-To headers in Microwaveprop.Mailer.apply_defaults/1
so UserNotifier and EditNotifier can't drift. Drops the EMAIL_FROM env var
override — both values are hardcoded now.
2026-04-12 14:00:38 -05:00

20 lines
523 B
Elixir

defmodule Microwaveprop.Mailer do
@moduledoc false
use Swoosh.Mailer, otp_app: :microwaveprop
import Swoosh.Email
@from {"NTMS Propagation", "prop@w5isp.com"}
@reply_to "graham@mcintire.me"
@doc """
Apply the site-wide `From:` and `Reply-To:` headers to an outgoing email.
Centralized here so `UserNotifier` and `EditNotifier` can't drift.
"""
@spec apply_defaults(Swoosh.Email.t()) :: Swoosh.Email.t()
def apply_defaults(email) do
email
|> from(@from)
|> reply_to(@reply_to)
end
end