feat(automations): form-driven branching rules, round-robin assignment, lead-linked activities
This commit is contained in:
@@ -385,7 +385,19 @@ export class LeadFormsService {
|
||||
personId,
|
||||
ownerId: ownerId ?? actorId,
|
||||
};
|
||||
await this.automations.runTrigger('lead_submitted', leadCtx);
|
||||
await this.automations.runTrigger('lead_submitted', {
|
||||
...leadCtx,
|
||||
entityType: personId ? 'person' : leadId ? 'lead' : 'person',
|
||||
sourceId: form.id,
|
||||
sourceType: 'lead_form',
|
||||
leadId,
|
||||
mobile: mapped.mobile ?? mapped.phone ?? null,
|
||||
formName: form.name,
|
||||
formValues: values,
|
||||
formFields: form.fields
|
||||
.filter((f) => f.fieldType !== 'heading')
|
||||
.map((f) => ({ key: f.key, label: f.label })),
|
||||
});
|
||||
await this.messageAutomations.onEvent('lead_submitted', leadCtx);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user