PhoenixKit 1.7.214: Notifications by email and Telegram, with digests
PhoenixKit 1.7.214 lets users get their notifications by email or Telegram as well as in the app, and lets busy notification types arrive as one summary instead of one message each.
On My Settings at /admin/notifications/settings, each user picks per type where notifications go: In-app, Email, or Telegram through their own bot connection. Under Aggregation a type can be Immediate, Hourly, Every 12 hours, Daily or Weekly.
Integrations are now split into My Integrations, for a user’s own connections, and Website Integrations, each with its own permission. Settings gets a Content Editor section with a Default Editor Mode. Disabled modules are now closed to everyone, the Owner included, and permission changes are written to the activity feed. Migration V159 adds publishing categories and daily post view counts.
Upgrading
Run mix phoenix_kit.update. It applies V159 and adds the digest jobs to your Oban cron, without which daily or weekly notifications are never sent.
Full release notes: PhoenixKit 1.7.214
1.7.214 · 27 July 2026
Added
- Notification delivery channels (PR #665) — a parallel routing layer that
sends notifications to external destinations alongside the in-app inbox.
Core ships Email (always available, uses the account address) and Telegram
(auto-discovers the recipient’s personal bot connection and its captured
chats); feature modules contribute more via the optional
notification_channels/0callback. Per-user, per-type opt-in lives inusers.custom_fieldsunder onenotification_channel:<key>key per channel, so no migration is needed and the inbox path is untouched — “Telegram on, inbox off” works. Delivery runs off the hot path on a dedicated:notificationsOban queue with a permanent/transient error taxonomy (a blocked bot soft-disables the channel instead of retry-storming). - Notification aggregation (PR #665) — each type can be routed on a digest
cadence (hourly / 12h / daily / weekly) per delivery mode instead of pinging
per event;
PhoenixKit.Notifications.DigestWorkersweeps one fixed window per cadence on cron and sends a single summary, with no per-user last-sent state. In-app is a delivery mode too, so a digest cadence collapses the inbox to one summary row. - Personal (per-user) integrations (PR #665) — connections now carry an
owner (
:system | :any | {type, id}) stored in the existing JSONB (owner_type/owner_uuid, write-once, no migration). Two independent admin surfaces share the storage:/admin/settings/integrations(personal, gated by the newintegrationspermission key) and/admin/settings/integrations/website(website-wide, gated byintegrations_system). Providers declare which scopes they allow (Providers.scopes_of/1), enforced at row birth so a crafted event cannot create a personal OAuth connection. "*"superadmin permission key (PR #665) — a blanket, drift-immune grant that makes a role Owner-equivalent for feature access without enumerating keys, honored byScope.has_module_access?/2,can?/2andaccessible_modules/1. Owner holds it structurally; a host can grant it to a custom role. Role-management safety rails (editing Admin, assigning Owner/Admin, the last-Owner guard) stay role-name-based and are NOT unlocked by it.- Permission audit trail (PR #665) —
permission.granted/permission.revoked/permission.syncedactivity entries for user-initiated changes (the boot-time auto-grant sweep passes no actor, so startup never floods the feed). - Telegram bot client (PR #665) —
PhoenixKit.Integrations.Telegram:send_message/4plus a one-shotget_updates/2used purely to discover a user’schat_idduring chat linking. - Site-wide Default Editor Mode setting (PR #664) —
editor_default_mode(Hybrid / Visual / Markdown / HTML) under a new “Content Editor” section on/admin/settings, plusPhoenixKit.Settings.get_editor_mode/0returning the mode as an atom ready for Leaf’smodeattr. No migration: the settings LV mergesget_defaults/0over the stored rows. - V159 (PR #665) — publishing categories (hierarchical per-group taxonomy,
slugunique per group,name_i18nper-language names), post↔category M:N assignment, and per-day post view rollups.
Changed
Scope.admin?/1is renamedScope.can_access_admin_area?/1(PR #665). The old name misled — it is true for ANY permission holder, not just the Admin role.admin?/1remains as a@deprecatedalias. For a “can do everything, like Owner” check useholds_all_enabled_permissions?/1orsuperadmin?/1.- Disabled modules are now blocked for everyone, Owner included (PR #665), uniformly across the LiveView mount hook, the fresh-mount gate and the plug — previously Owner bypassed enablement in two of the three, so the same user saw a disabled module’s page through one gate and a redirect through another.
- Unmapped admin views now require a full-access scope (PR #665) rather than
system_role?, so a named Admin whose keys an Owner partially revoked no longer reaches them. A default Admin still passes (the baseline is enabled keys minus the opt-in ones); a deliberately-stripped role gets blanket access via the"*"key. - Every permission mutation path (
grant_permission,revoke_permission,set_permissions,revoke_all_permissions) now takes the same role-row lock first (PR #665). Previously per-key grants and the whole-role sync used disjoint lock objects, so a grant committed mid-set_permissionssurvived a strip the Owner intended. leaf0.3.2 (PR #664) — hex pin and the CDN pin inpriv/static/assets/phoenix_kit.jsmoved in lockstep.usage_rules1.2.7.
Fixed
mix phoenix_kit.updatenow backfills the notification digest cron entries (post-merge review of #665).ensure_cron_plugin/2short-circuits as soon asProcessScheduledJobsWorkeris in the crontab, so an existing host got the new:notificationsqueue but never the fourDigestWorkerentries — andDigestWorkerhas no other enqueue site. Because the creation path already suppresses the per-event inbox row once a type is on a non-immediate cadence, a user picking “Daily” on an upgraded host got no per-event row and no summary: the notifications were silently lost, in-app and external alike. The newObanConfig.ensure_digest_cron_entries/2adds each missing cadence independently and anchors the crontab block’s closing bracket to thecrontab:keyword’s own indentation, so a lazy match cannot land entries inside a nested list.- The notification settings page no longer persists unvalidated keys from form
params (post-merge review of #665).
save_channel_types/2andsave_cadences/2used raw param keys as storage keys, so a crafted submit wrote arbitrarynotification_channel:<anything>blobs — with arbitrary nested type/cadence entries — into the user’scustom_fieldsJSONB. Both now filter againstChannels.keys()/["inapp" | Channels.keys()]andTypes.all_pref_keys(), matching what the sibling in-app save already did. - Module-contributed notification channels are no longer dropped in a
release (post-merge review of #665).
Channels.external_channels/0guarded with a barefunction_exported?/3, which answers false for a module that has not been loaded yet — the norm under lazy loading. It now callsCode.ensure_loaded?/1first, matching the siblingTypes.external_types/0. - A wholly-failed Telegram broadcast is no longer silent (post-merge review
of #665). When every chat fails permanently the channel still reports
:ok(one blocked subscriber must not disable a working broadcast), but a revoked token or a bot kicked everywhere looked exactly like a successful delivery. It now logs a warning naming the target count and the failures. - The editor-mode allowlist has a single source (post-merge review of #664).
The four modes were written out independently in
editor_mode_options/0, the changeset’svalidate_inclusion, andget_editor_mode/0’s coercion clauses — whileeditor_mode_options/0’s docstring claimed to be the single source for all three. A mode added to two of the three either saves and silently coerces back to:hybrid, or is offered in the picker and rejected by the changeset. All three now derive from one@editor_modeslist.
PhoenixKit 1.7.214. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.