feat: provide clear errors for missing required envs
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Simon 2026-03-23 12:55:05 +01:00
parent f8a3cc4c47
commit 61952f986d
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
6 changed files with 146 additions and 27 deletions

View file

@ -100,7 +100,11 @@ defmodule Mv.Mailer do
"""
@spec smtp_config() :: keyword()
def smtp_config do
if Mv.Config.smtp_configured?() and not boot_smtp_configured?() do
# In test we use Swoosh.Adapters.Test; do not override with SMTP opts or emails would not land in the test mailbox.
adapter = Application.get_env(:mv, __MODULE__, []) |> Keyword.get(:adapter)
if Mv.Config.smtp_configured?() and not boot_smtp_configured?() and
adapter != Swoosh.Adapters.Test do
verify_mode =
if Application.get_env(:mv, :smtp_verify_peer, false),
do: :verify_peer,