feat: provider sender addresses with contingent from-address pickers #11

Merged
KofTwentyTwo merged 14 commits from feature/sender-addresses into develop 2026-10-14 12:34:28 +00:00
KofTwentyTwo commented 2026-10-14 12:23:37 +00:00 (Migrated from github.com)

Stacked on #9. Adds the provider → from-address contingent field the owner asked for (and reviews every other form FK).

  • email_provider_sender_address (child of the provider, admin-only): address (validated, lowercased, CR/LF refused), display name, default (one per provider, must be enabled), enabled, note; unique per provider; the domain must equal the provider's sending_domain.

  • Sending: EmailRequest.withFromAddressId; a from address by id or by text must be an enabled row of the resolved provider ("That from address is not set up for provider …"); the default row wins; the provider's from_address stays the fallback when it has no rows. email_message.from_address_id records the row; resend keeps it.

  • Contingent possible values (each with a metadata test and a core possible-value search test):

    1. email_send_templated.fromAddressId by providerId = ${input.providerId}
    2. email_send_ad_hoc.fromAddressId, same
    3. Send Test Email fromAddressId by the acted-on provider (a prepare step seeds possibleValueFilterValueId from the selected record)
    4. email_message.fromAddressId by providerId
    5. email_message_attempt.messageId by providerId
    6. email_event.messageId by providerId
    7. email_suppression.sourceEventId by sourceMessageId

    Other FKs reviewed and left unfiltered on purpose (brands and templates are independent lists; parent FKs of their own rows).

Tests: 263 (20 new), all green; JaCoCo 94.6%; Checkstyle clean.

🤖 Generated with Claude Code

Stacked on #9. Adds the provider → from-address contingent field the owner asked for (and reviews every other form FK). - **`email_provider_sender_address`** (child of the provider, admin-only): address (validated, lowercased, CR/LF refused), display name, default (one per provider, must be enabled), enabled, note; unique per provider; the domain must equal the provider's `sending_domain`. - **Sending:** `EmailRequest.withFromAddressId`; a from address by id or by text must be an enabled row of the resolved provider ("That from address is not set up for provider …"); the default row wins; the provider's `from_address` stays the fallback when it has no rows. `email_message.from_address_id` records the row; resend keeps it. - **Contingent possible values** (each with a metadata test and a core possible-value search test): 1. `email_send_templated.fromAddressId` by `providerId = ${input.providerId}` 2. `email_send_ad_hoc.fromAddressId`, same 3. Send Test Email `fromAddressId` by the acted-on provider (a prepare step seeds `possibleValueFilterValueId` from the selected record) 4. `email_message.fromAddressId` by `providerId` 5. `email_message_attempt.messageId` by `providerId` 6. `email_event.messageId` by `providerId` 7. `email_suppression.sourceEventId` by `sourceMessageId` Other FKs reviewed and left unfiltered on purpose (brands and templates are independent lists; parent FKs of their own rows). Tests: 263 (20 new), all green; JaCoCo 94.6%; Checkstyle clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.