test: add tests for smtp mailer config

This commit is contained in:
Simon 2026-03-11 09:18:37 +01:00
parent f53a3ce3cc
commit c4135308e6
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
9 changed files with 440 additions and 0 deletions

View file

@ -16,4 +16,15 @@ defmodule Mv.Mailer do
def mail_from do
Application.get_env(:mv, :mail_from, {"Mila", "noreply@example.com"})
end
@doc """
Sends a test email to the given address. Used from Global Settings SMTP section.
Returns `{:ok, email}` on success, `{:error, reason}` on failure (e.g. invalid address,
SMTP not configured, connection error). Stub: always returns error until implemented.
"""
@spec send_test_email(String.t()) :: {:ok, Swoosh.Email.t()} | {:error, term()}
def send_test_email(_to_email) do
{:error, :not_implemented}
end
end