Files
cal.diy/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
T
89510e6af6 Zapier Trigger: After Meeting ends (#3827)
* add new trigger with first simple job scheduling

* fix DB update

* use array to save scheduled jobs in booking

* cancel scheduled jobs when zap disabled or zapier disconnected

* schedule jobs only for confirmed bookings

* schedule jobs for already existing bookings

* fix bug to create workflow reminders when confirming recurring events

* delete remove all zapier webhooks when api key is deleted

* schedule job for all confirmed recurring bookings

* fix zapier trigger and workflow reminders when cancelling recurring events

* code clean up

* code clean up

* add migration

* add type package for node-schedule

* remove nodescheduler

* add updated nodescheduler

* move code to app-store

* add meeting ended to webhook constants

* udpate zapier README.md

* implement QA suggestions

* add default handler and fix imports

* Type fix

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Omar López <[email protected]>
2022-08-15 20:18:41 +00:00

43 lines
1.5 KiB
TypeScript

import dayjs from "@calcom/dayjs";
const emailReminderTemplate = (
startTime: string,
endTime: string,
eventName: string,
timeZone: string,
attendee: string,
name: string
) => {
const emailSubject = `Reminder: ${eventName} - ${dayjs(startTime)
.tz(timeZone)
.format("ddd, MMM D, YYYY")} ${dayjs(startTime).tz(timeZone).format("H:mmA")}`;
const templateBodyText = `Hi ${name},this is a reminder that your meeting (${eventName}) with ${attendee} is on ${dayjs(
startTime
)
.tz(timeZone)
.format("YYYY MMM D")} at ${dayjs(startTime).tz(timeZone).format("h:mmA")} ${timeZone}.`;
const introHtml = `<body>Hi ${name},<br><br>This is a reminder about your upcoming event.<br><br>`;
const eventHtml = `<div style="font-weight: bold;">Event:</div>${eventName}<br><br>`;
const dateTimeHtml = `<div style="font-weight: bold;">Date & Time:</div>${dayjs(startTime)
.tz(timeZone)
.format("ddd, MMM D, YYYY H:mmA")} - ${dayjs(endTime)
.tz(timeZone)
.format("H:mmA")} (${timeZone})<br><br>`;
const attendeeHtml = `<div style="font-weight: bold;">Attendees:</div>You & ${attendee}<br><br>`;
const endingHtml = `This reminder was triggered by a Workflow in Cal.<br><br>_<br><br>Scheduling by Cal.com</body>`;
const templateBodyHtml = introHtml + eventHtml + dateTimeHtml + attendeeHtml + endingHtml;
const emailBody = { text: templateBodyText, html: templateBodyHtml };
return { emailSubject, emailBody };
};
export default emailReminderTemplate;