feat(workflows): pre-event reminder picks the template GROUP on the block, type stays automatic
The reminder template family (prefix) is now chosen on the notify_pre_event block via config.templateGroup (default 'event_reminder'); within that group the exact template is still auto-resolved per event type: <group>_<eventType> if authored → else <group>_default So an admin can point a flow at a different reminder family, while wedding/ birthday/… routing and the catch-all fallback stay automatic. resolveTemplateKey now takes (eventType, group) and tolerates a trailing "_" on the group. Editor: notify_pre_event (+ the gallery notify actions) added to the action dropdown, with a "Reminder template group" field and hint. Seed sets templateGroup='event_reminder' on the built-in (v4). EN/DE strings. Tests cover the per-type / group-default resolution.
This commit is contained in:
@@ -170,8 +170,12 @@ registry.registerAction('notify_gallery_expired', async (ctx) => {
|
||||
registry.registerAction('notify_pre_event', async (ctx) => {
|
||||
const id = ctx.run.entity_id;
|
||||
if (!id) return { skipped: true, reason: 'no event entity' };
|
||||
if (ctx.vars?.__dryRun) return { dryRun: true, would: 'notify_pre_event', eventId: id };
|
||||
const res = await require('../eventReminderService').sendReminderForEvent(id);
|
||||
// The template GROUP is chosen on THIS block (config.templateGroup, e.g.
|
||||
// 'event_reminder'); the exact template is still auto-picked by event type
|
||||
// within that group. Blank → the default group.
|
||||
const templateGroup = ctx.node.config?.templateGroup || null;
|
||||
if (ctx.vars?.__dryRun) return { dryRun: true, would: 'notify_pre_event', eventId: id, templateGroup };
|
||||
const res = await require('../eventReminderService').sendReminderForEvent(id, { templateGroup });
|
||||
return res;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user