Skip to content

lead-sla-breach

Source of truth: packages/notifications/src/translations.ts

DomainChannelsRecipients
leadsin-app + email + pushAssigned agent (tier 1)
SourceContext
apps/worker/src/leads.ts:274processSlaMonitor
interface LeadSlaBreachData {
customerName: string;
propertyAddress: string;
thresholdMinutes: number;
leadsUrl: string;
}

The caller invokes triggerWorkflow('lead-sla-breach', recipientIds, data) where data is the LeadSlaBreachData shape above. The server pre-translates the payload via getTranslatedPayload('lead-sla-breach', recipientLocale, data) from @repo/notifications before sending, producing { inAppBody, emailSubject, emailBody } for the dashboard templates to render.

Knock dashboard template body: {{ inAppBody }}.

LocalePreview source
es⚠️ El lead de ${p.customerName} (${p.propertyAddress}) lleva más de ${p.thresholdMinutes} min sin atención
en⚠️ Lead from ${p.customerName} (${p.propertyAddress}) has been untouched for over ${p.thresholdMinutes} min

Subject: {{ emailSubject }}. Body: {{ emailBody }} (HTML mode, dashboard escaping OFF — every user-supplied string is escaped server-side via escapeHtml from @repo/notifications).

LocaleSubject preview
esSLA vencido — lead de ${p.customerName}
enSLA breached — lead from ${p.customerName}

Email body is composed by emailBody.es in packages/notifications/src/translations.ts via the layout components in packages/notifications/src/email-layout.ts (wrapEmailLayout, ctaButton, calloutBox, quoteBlock, propertyCard, detailTable / detailRow). Body source is not inlined here because it spans tens of lines per locale — open the source file for the full template.

Push delivery is configured at the Knock dashboard level for this workflow (FCM channel step with {{ inAppBody }} as the notification body). iOS APNs is deferred until the dashboard p8 key is wired — see Configuration → mobile push.