fix(automations): corrige erro de import dinamico no envio de email
Some checks failed
Some checks failed
- Move renderizacao do React Email para a action Node.js - Passa props do email em vez do HTML ja renderizado - Resolve erro "dynamic module import unsupported" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bddce33217
commit
b8170d0225
2 changed files with 50 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ import {
|
|||
} from "./automationsEngine"
|
||||
import { getTemplateByKey, normalizeFormTemplateKey } from "./ticketFormTemplates"
|
||||
import { TICKET_FORM_CONFIG } from "./ticketForms.config"
|
||||
import { renderAutomationEmailHtml, type AutomationEmailProps } from "./reactEmail"
|
||||
import type { AutomationEmailProps } from "./reactEmail"
|
||||
import { buildBaseUrl } from "./url"
|
||||
import { applyChecklistTemplateToItems, type TicketChecklistItem } from "./ticketChecklist"
|
||||
|
||||
|
|
@ -988,12 +988,25 @@ async function applyActions(
|
|||
ctaLabel,
|
||||
ctaUrl,
|
||||
}
|
||||
const html = await renderAutomationEmailHtml(emailProps)
|
||||
|
||||
await schedulerRunAfter(1, api.ticketNotifications.sendAutomationEmail, {
|
||||
to,
|
||||
subject,
|
||||
html,
|
||||
emailProps: {
|
||||
title: emailProps.title,
|
||||
message: emailProps.message,
|
||||
ticket: {
|
||||
reference: emailProps.ticket.reference,
|
||||
subject: emailProps.ticket.subject,
|
||||
status: emailProps.ticket.status ?? null,
|
||||
priority: emailProps.ticket.priority ?? null,
|
||||
companyName: emailProps.ticket.companyName ?? null,
|
||||
requesterName: emailProps.ticket.requesterName ?? null,
|
||||
assigneeName: emailProps.ticket.assigneeName ?? null,
|
||||
},
|
||||
ctaLabel: emailProps.ctaLabel,
|
||||
ctaUrl: emailProps.ctaUrl,
|
||||
},
|
||||
})
|
||||
|
||||
applied.push({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue