Skip to content

PhoenixKit 1.7.203: An Email Sending page, send profiles in core and working SMTP

PhoenixKit 1.7.203 adds an Email Sending page under Settings, moves send profiles from the Newsletters module into core, and fixes SMTP sending, which could not connect over TLS at all.

The page shows the sender identity, the detected transport and the email-capable integrations, with Send Profiles as its own entry below it. For SES and Brevo it shows each profile’s quota or credits. Test Connection for SES, SMTP and Brevo now really contacts the service instead of marking it connected.

SMTP on port 465 and STARTTLS failed because no TLS options were built. Now they are, and a relay that needs a password no longer falls back to sending it unencrypted. A connection with a blank required field no longer crashes delivery with the secret in the error.

Upgrading

Run mix phoenix_kit.update for V152, which copies send profiles into core and adds CRM list tables. SMTP now needs a CA bundle: on slim images, install ca-certificates. SMTP hosts are no longer looked up by MX record, so point host at the relay itself.

Full release notes: PhoenixKit 1.7.203

1.7.203 · 18 July 2026

Added

  • Send Profiles moved from phoenix_kit_newsletters into core. PhoenixKit.Email.SendProfile/SendProfiles are now shared infrastructure any module can send through, routed via the profile’s Integrations connection (per-provider ProviderOptions, including SES/Brevo configuration-set and tag options). App-config transport is now detect-and-display only.
  • New Settings → Email Sending page: transport detection, default-profile picker, and a seam (email_settings_sections/0) where external modules (e.g. the emails package) mount their own settings sections as live_components instead of owning a separate Settings tab. Send Profiles CRUD gets its own nested sidebar entry under Email Sending.
  • Quota/credits surfacing per send profile: SES GetSendQuota and Brevo /account (plan + credits) are now shown per profile; a validator that cannot verify actual sending capability (e.g. SES credentials scoped to ses:SendEmail alone) says so instead of showing a bare green tick.
  • Migration V152: email_send_profiles created in core (uuid-preserving copy from the old newsletters table, which is then dropped); CRM contact list groundwork (phoenix_kit_crm_lists, phoenix_kit_crm_list_members, citext member email); broadcasts can now source recipients from a CRM list (source_type/crm_list_uuid, soft reference).

Fixed

  • A stored email connection with a blank required field (SMTP host, SES aws_region) could crash mail delivery with the plaintext secret embedded in the crash message. A connection’s status can say “connected” while an individual field was blanked out after the last successful validation; that reached Swoosh.Mailer.deliver/2 uncaught, which raises with the entire adapter config — password/access key included — inlined in the exception text. PhoenixKit.Mailer.swoosh_config_for/1 now validates required fields itself and fails closed with {:error, {:incomplete_credentials, [field_names]}} before any secret-bearing config is built.
  • pagination_range/2 could OOM the whole BEAM. An unclamped current_page (e.g. ?page=9999999999) built a descending 9999999997..56 Range — ~10 billion iterations in the component’s for. Now clamps into [1, max(total_pages, 1)] with an explicit //1 step as a second guard; pagination_controls/1 additionally gained a total_pages > 1 outer guard.
  • table_default’s search toolbar rendered no <form> when only on_change was given — phx-change on a formless input dies silently client-side. The form is now always rendered.
  • Admin view permission map: five settings LiveViews (Integrations, IntegrationForm, EmailSending, SendProfiles, SendProfileForm) resolved to nil → custom “settings”-scoped roles were denied. Mapped explicitly.
  • A plugin module assigning page_section was a silent no-op — admin.html.heex now forwards it (and page_section_path) to the layout.
  • The universal smtp integration provider could not send at all. gen_smtp supplies no TLS options of its own and OTP’s :ssl now defaults to verify: :verify_peer with no CA store, so port 465 died with {:options, :incompatible} and STARTTLS died with :tls_failed. The transport now builds the options properly (PhoenixKit.Mailer.SmtpTransport), including the depth gen_smtp otherwise defaults to 0 — which rejects every real certificate chain.
  • “Test Connection” verified nothing for aws_ses, smtp and brevo_api: the connection was stamped "connected" without a byte leaving the box, so a wrong key showed green and then failed at send time. All three now perform a real check, bounded by a deadline.
  • A failed connection check could take the operator’s page down, or leak a socket for twenty minutes. :gen_smtp_client.open/1 runs in the calling process and waits on a hard-coded 20-minute timeout past connect; the checks now run in an isolated, linked-and-monitored process (PhoenixKit.Integrations.Probe) that neither kills its caller nor outlives it.

Security

  • SMTP no longer sends in plaintext when TLS cannot be established. tls: :if_available had been masking the broken TLS configuration above by silently falling back to an unencrypted session — with the relay password on the wire. A relay that expects credentials now fails closed.

Changed — may require action on upgrade

  • SMTP sending now stops on images with no CA bundle ({:error, :no_ca_store}) instead of proceeding with certificate verification disabled. Slim base images (distroless, scratch, some Alpine builds) are affected: install ca-certificates. A relay configured with no username or password still degrades rather than failing — it has no credentials to protect.
  • Configured SMTP relays are no longer MX-resolved (no_mx_lookups: true). gen_smtp would otherwise look up the relay’s MX records and connect to whatever they point at, while SNI and the hostname check stay pinned to the configured name — a guaranteed certificate mismatch. If you configured host as a bare domain and relied on MX resolution, point it at the relay itself.
  • AWS SES credentials scoped to ses:SendEmail alone now pass Test Connection with a note rather than a bare green tick. They cannot read the send quota, so the check can prove the credentials are valid but not that they can send, and it now says so on screen instead of only in the log.

PhoenixKit 1.7.203. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.