Fix empty auth smtp

This commit is contained in:
Alex Lion
2024-12-27 10:40:36 -05:00
parent a669d64352
commit b695226fec
2 changed files with 16 additions and 2 deletions

View File

@@ -15,6 +15,7 @@
- Add button to trigger product tour instead of automatically starting it
- Improve design and UX for interactions and presentation settings in the manager view
- Add pagination for events on the dashboard
- Fix STMP adapter to work with secure connection
## v2.2.0

View File

@@ -190,8 +190,21 @@ case mail_transport do
config :claper, Claper.Mailer,
adapter: Swoosh.Adapters.Mua,
relay: smtp_relay,
port: smtp_port,
auth: [username: smtp_username, password: smtp_password]
port: smtp_port
cond do
smtp_username && smtp_password ->
config :claper, Claper.Mailer, auth: [username: smtp_username, password: smtp_password]
smtp_username || smtp_password ->
raise ArgumentError, """
Both SMTP_USERNAME and SMTP_PASSWORD must be set for SMTP authentication.
Please provide values for both environment variables.
"""
true ->
nil
end
config :swoosh, :api_client, false