PhoenixKit 1.7.221: Failed emails no longer look sent, CRM card on user pages
PhoenixKit 1.7.221 fixes email status badges that showed a failed email as sent, and links a user’s page to their CRM contact.
The email activity badges carry their meaning in colour. When a log said the send had failed but the matching event or time was missing, the list showed the plain blue “sent” badge while the email’s own page said it failed. A failed send, including a spam complaint, now always shows its failure badge, and a soft bounce stays amber as on the detail page.
With the CRM module installed and enabled, a user linked to a CRM contact now gets a CRM card on their admin page, with a link to the contact. Only viewers with the crm permission see it.
Full release notes: PhoenixKit 1.7.221
1.7.221 · 29 July 2026
Added
- A failed email never renders as merely sent (#674) — the activity badges
carry their whole meaning in colour (the text is only ever a timestamp), so a
log whose
statussays the send failed but whose matching timestamp or event is missing rendered as the plain blue “sent” badge, contradicting the detail page for the same log. A status-only badge now covers that gap. - CRM contact card on the user detail page (#674) — when the optional CRM module is installed and enabled, a user linked to a CRM contact gets a card linking straight to it.
Fixed
- Spam complaints were left showing as sent (#674 review) — the new failure
whitelist spelled the status
complained, which no writer in the tree sets, and omittedcomplaint, which is whatSqsProcessoractually writes and whatEmails.Log’s changeset validates. Five of the six failure statuses were covered and the dead entry made the list look complete. - Soft bounces stay amber in the activity column (#674 review) — the
status-only badge hardcoded
badge-errorfor every failure status, repainting a retryable soft bounce red in the list while the detail page showed it amber. Colour and label now come fromEmailStatusBadge, so core holds one status → colour/label map instead of two that drift. - The CRM card checks the viewer’s
crmpermission (#674 review) — every admin route shares onelive_sessiongated only bycan_access_admin_area?/1, so a role holdingusersbut notcrmrendered a contact’s name and was then bounced to/byenforce_admin_view_permission/2on clicking through. The permission check also skips the query for viewers who would never see the card. - A contact with no name renders a visible link (#674 review) —
phoenix_kit_crm_contacts.nameis nullable, and the card read.namedirectly instead of CRM’s owndisplay_name/1fallback chain, so such a contact rendered the card’s only link as empty text.
Tests
email_activity_badges_test.exs(new) — the component had none. Enumerates the canonical status list fromEmails.Log’s changeset and asserts the failure subset against it both ways, so a whitelist that invents or drops a status fails a test whose message says why. Also pins colour parity withEmailStatusBadge, the labels, and the no-duplicate path.
i18n
- The CRM card’s new strings are translated (#674 review) —
This user is linked to a CRM contact.andUnnamed contactreached neitherdefault.potnor ru/et, the two locales kept at 100%. Appended by hand for the same reason as 1.7.220: a fullgettext.extract --mergenow reports 195 new / 53 fuzzy per locale, a repo-wide backlog this PR did not cause.CRMneeded nothing — it already exists as a msgid and is translated in both.
PhoenixKit 1.7.221. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.