namespace email settings keys per adapter
All checks were successful
deploy / deploy (push) Successful in 57s

Settings keys like api_key were shared across providers, so switching
from e.g. Postmark to SendGrid showed the old API key. Now each
adapter gets its own namespaced key (email_postmark_api_key, etc.)
so credentials persist independently and switching back pre-fills
previously saved values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-21 19:57:23 +00:00
parent 366a1e6a48
commit 194fec8240
6 changed files with 72 additions and 34 deletions

View File

@@ -113,7 +113,7 @@ defmodule BerrypodWeb.Admin.EmailSettingsTest do
test "disconnect clears email configuration", %{conn: conn} do
Settings.put_setting("email_adapter", "postmark")
Settings.put_secret("email_api_key", "pm_test_abc")
Settings.put_secret("email_postmark_api_key", "pm_test_abc")
{:ok, view, _html} = live(conn, ~p"/admin/settings/email")
@@ -125,7 +125,7 @@ defmodule BerrypodWeb.Admin.EmailSettingsTest do
test "shows test email section when configured", %{conn: conn} do
Settings.put_setting("email_adapter", "postmark")
Settings.put_secret("email_api_key", "pm_test_abc")
Settings.put_secret("email_postmark_api_key", "pm_test_abc")
{:ok, _view, html} = live(conn, ~p"/admin/settings/email")