From c02c947463011de80d9af3e947fc6d1caadc3313 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Tue, 12 May 2026 01:25:12 +0200 Subject: [PATCH] feat(customers): email customer when admin adds new gallery access --- ..._add_customer_gallery_assigned_template.js | 243 ++++++++++++++++++ .../src/services/customerAccountsService.js | 118 ++++++++- backend/src/services/emailProcessor.js | 11 +- 3 files changed, 368 insertions(+), 4 deletions(-) create mode 100644 backend/migrations/core/101_add_customer_gallery_assigned_template.js diff --git a/backend/migrations/core/101_add_customer_gallery_assigned_template.js b/backend/migrations/core/101_add_customer_gallery_assigned_template.js new file mode 100644 index 00000000..557c400b --- /dev/null +++ b/backend/migrations/core/101_add_customer_gallery_assigned_template.js @@ -0,0 +1,243 @@ +/** + * Migration: Add `customer_gallery_assigned` email template. + * + * Sent when an admin adds new gallery assignments to an existing + * customer via the "Manage galleries" dialog on the customer detail + * page. Digest-style — one email per save listing every newly added + * gallery, not one email per gallery (admins often set up new clients + * by adding several galleries in a single sitting). + * + * Variables: + * - customer_name greeting name (display name / first name / email local) + * - gallery_count integer (string) — number of newly added galleries + * - singular "true" when count === 1 (drives intro wording) + * - multiple "true" when count > 1 + * - gallery_list_html pre-rendered