PhoenixKit 1.7.207: Newsletter lists move into the CRM
PhoenixKit 1.7.207 moves newsletter mailing lists into the CRM. Migration V156 copies the lists and their members into the CRM’s lists, points each broadcast at its CRM list, and then drops the old newsletter list tables and column.
Saving a user’s custom fields is now done in one database update per key. Before, two changes made at the same moment, such as a language switch and a newsletter opt-out, could overwrite each other and lose one of them.
Upgrading
Run mix phoenix_kit.update to apply V156, together with the Newsletters release made for it: the migration removes tables older Newsletters releases still read. The migration’s own documentation describes the coordinated upgrade.
Full release notes: PhoenixKit 1.7.207
1.7.207 · 21 July 2026
Added
- Migration V156 — migrates legacy
phoenix_kit_newsletters_lists/..._list_membersinto the CRM’sphoenix_kit_crm_lists/..._crm_list_members(spec §4.5), re-pointsphoenix_kit_newsletters_broadcastsofflist_uuidontosource_type = 'crm_list'/crm_list_uuid, then drops the legacy tables and column entirely. Requires a coordinated release with the newsletters module — see the migration’s moduledoc warning.@current_versionbumped 155 → 156. PhoenixKit.Users.Auth.merge_user_custom_fields/3— atomically merges keys into a user’scustom_fieldsJSONB column at the database level (custom_fields || additionsinside theUPDATEitself), closing a lost-update race where two callers merging different keys concurrently (e.g. a locale-preference switch and a newsletters opt-out) could silently drop one writer’s key.delete_user_custom_field/3gets the same atomic treatment (custom_fields - key);set_user_custom_field/3andupdate_user_locale_preference/2now route through these atomic primitives instead of a read-modify-write whole-map replace.PhoenixKit.RepoHelper.update_all/3— delegate to the configured repo’supdate_all/3, needed by the atomic custom-fields primitives above.
Fixed
merge_user_custom_fields/3anddelete_user_custom_field/3now bumpupdated_aton write (missed in the initial PR sinceRepo.update_all/2, unlike a changeset-backedRepo.update/2, doesn’t auto-stamp timestamps).
PhoenixKit 1.7.207. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.