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:
@@ -255,6 +255,8 @@
|
||||
"saveFailed": "Speichern fehlgeschlagen",
|
||||
"badJson": "Konfiguration ist kein gültiges JSON",
|
||||
"daysBefore": "Tage vor dem Anlass",
|
||||
"templateGroup": "Vorlagengruppe für Erinnerungen",
|
||||
"templateGroupHint": "Die genaue Vorlage wird je Anlasstyp innerhalb dieser Gruppe automatisch gewählt: «Gruppe»_«Anlasstyp», falls vorhanden, sonst «Gruppe»_default. Leer = event_reminder.",
|
||||
"showAdvanced": "Erweitert (JSON)",
|
||||
"hideAdvanced": "Erweitert ausblenden (JSON)",
|
||||
"triggerHint": "Der Auslöser wird oben in der Leiste gesetzt (Wenn …).",
|
||||
|
||||
@@ -255,6 +255,8 @@
|
||||
"saveFailed": "Could not save",
|
||||
"badJson": "Config is not valid JSON",
|
||||
"daysBefore": "days before event",
|
||||
"templateGroup": "Reminder template group",
|
||||
"templateGroupHint": "The exact template is auto-picked per event type within this group: «group»_«eventType» if you authored one, else «group»_default. Blank = event_reminder.",
|
||||
"showAdvanced": "Advanced (JSON)",
|
||||
"hideAdvanced": "Hide advanced (JSON)",
|
||||
"triggerHint": "The trigger is set in the toolbar above (When …).",
|
||||
|
||||
@@ -22,6 +22,9 @@ const ACTIONS = [
|
||||
['queue_payment_check', 'Send payment-check email (dunning gate)'],
|
||||
['escalate_to_collections', 'Hand off to collections (email admin)'],
|
||||
['send_email', 'Send email'],
|
||||
['notify_pre_event', 'Send pre-event reminder'],
|
||||
['notify_gallery_expiring', 'Send gallery-expiring warning'],
|
||||
['notify_gallery_expired', 'Send gallery-expired email'],
|
||||
['reserve_date', 'Reserve the event date'],
|
||||
['prepare_quote', 'Prepare a quote (draft)'],
|
||||
['prepare_contract', 'Prepare a contract (draft)'],
|
||||
@@ -96,6 +99,15 @@ export const NodeConfigPanel: React.FC<Props> = ({ nodeType, config, onChange })
|
||||
</>
|
||||
)}
|
||||
|
||||
{nodeType === 'action' && config.action === 'notify_pre_event' && (
|
||||
<Row label={t('workflows.editor.templateGroup', 'Reminder template group')}>
|
||||
<input className={field} value={config.templateGroup || ''} onChange={(e) => set({ templateGroup: e.target.value })} placeholder="event_reminder" />
|
||||
<p className="text-xs text-neutral-500 dark:text-neutral-400 mt-1">
|
||||
{t('workflows.editor.templateGroupHint', 'The exact template is auto-picked per event type within this group: «group»_«eventType» if you authored one, else «group»_default. Blank = event_reminder.')}
|
||||
</p>
|
||||
</Row>
|
||||
)}
|
||||
|
||||
{(nodeType === 'action' || nodeType === 'webhook') && (config.action === 'webhook' || nodeType === 'webhook') && (
|
||||
<Row label={t('workflows.editor.webhookUrl', 'Webhook URL')}>
|
||||
<input className={field} value={config.url || ''} onChange={(e) => set({ url: e.target.value })} placeholder="https://…" />
|
||||
|
||||
@@ -45,6 +45,7 @@ const SOURCE_HANDLES: Record<string, string[]> = {
|
||||
const WAIT_ANCHOR_LABEL: Record<string, string> = { dueDate: 'due date', issueDate: 'invoice date', eventDate: 'event date' };
|
||||
const ACTION_LABEL: Record<string, string> = {
|
||||
queue_payment_check: 'Send payment-check email', escalate_to_collections: 'Collections handoff', send_email: 'Send email', reserve_date: 'Reserve the date',
|
||||
notify_pre_event: 'Send pre-event reminder', notify_gallery_expiring: 'Send gallery-expiring warning', notify_gallery_expired: 'Send gallery-expired email',
|
||||
prepare_quote: 'Prepare quote', prepare_contract: 'Prepare contract', prepare_invoice: 'Prepare invoice',
|
||||
prepare_event: 'Create event', prepare_gallery: 'Create gallery', send_document: 'Send document',
|
||||
webhook: 'Call webhook', noop: 'Do nothing', set_context: 'Set value',
|
||||
|
||||
Reference in New Issue
Block a user