defmodule MvWeb.Emails.JoinAlreadyPendingEmail do @moduledoc """ Sends an email when someone submits the join form with an address that already has a submitted (confirmed) application under review. Used for anti-enumeration: the UI shows the same success message; only the email informs the recipient. Uses the unified email layout. """ use Gettext, backend: MvWeb.Gettext, otp_app: :mv alias MvWeb.Emails.JoinEmail @doc """ Sends the "application already under review" notice to the given address. Returns `{:ok, email}` on success, `{:error, reason}` on delivery failure. """ def send(email_address) when is_binary(email_address) do subject = gettext("Membership application – already under review") JoinEmail.deliver(email_address, "join_already_pending.html", subject) end end