feat: agregar soporte para plantillas de correo electrónico y contexto en el envío de notificaciones

This commit is contained in:
2026-08-20 11:38:50 -03:00
parent e4441fa476
commit b6399d28fc
13 changed files with 174 additions and 11 deletions
@@ -43,6 +43,30 @@ describe("ChannelDispatchers", () => {
);
});
it("sends email template data when provided", async () => {
await dispatchEmail({
appointmentId: "appointment-1",
systemToken: "system-token",
type: "reminder",
email: "client@example.com",
templateId: "template-1",
context: { username: "Client Name" },
});
expect(mockedAxios.post).toHaveBeenCalledWith(
"https://api.example.com/notifications/send-email",
{
systemToken: "system-token",
email: "client@example.com",
templateId: "template-1",
context: { username: "Client Name" },
},
{
headers: { "Content-Type": "application/json" },
}
);
});
it("sends the job type in the WhatsApp system notification payload", async () => {
await dispatchWhatsApp({
companyId: "company-1",