Problem
One of our platform customers has reported that the reminder emails sent by the workflow still have cal.com branding. We already hide cal.com branding at the bottom when sending scheduled meeting emails on behalf of platform customers in BaseScheduledEmail.tsx
<BaseEmailHtml
hideLogo={Boolean(props.calEvent.platformClientId)}
Solution
When a sending email reminder via workflow for a booking that belongs to a managed user which is tied to a specific PlatformOAuth client, then hide footer.
Remove cal.com branding for all platform OAuth clients all workflow emails.
Implementation
- Store
platformClientId in booking metadata in the old controller 2024-04-15/controllers/bookings.controller.ts and in the new controller's service 2024-08-13/services/input.service.ts. Reflect this in the schema prisma/zod-utils.ts. We need to store platformClientId for workflows that are triggered by tasked later at some point - they only have booking uid available so then they need to know whether or not to disable branding.
- The old tasker scheduleEmailReminders.ts accesses
platformClientId in the booking's metadata and if it is defined sets isBrandingDisabled to true.
- The new tasker sendWorkflowEmails.ts does the same but passes
platformClientId to calendar event builder which attaches platformClientId to event created that then is accessed by the EmailWorkflowService.ts to decide whether or not to hide branding.
- In the RegularBookingService.ts we hide branding if
platformClientId is provided. Notably, we don't need to access platformClientId for immediate workflows because we know platformClientId already.
Test
For a platform team i created a workflow trigger that sends an email when event is scheduled:
curl -X POST "http://localhost:5555/api/v2/organizations/1/teams/20/workflows" \
-H "Content-Type: application/json" \
-H "x-cal-client-id: clxyyy21o0003sbk7yw5z6tzg" \
-H "x-cal-secret-key: eyJuYW1lIjoiQWNtZSAiLCJwZXJtaXNzaW9ucyI6MTAyMywicmVkaXJlY3RVcmlzIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NDMyMSJdLCJib29raW5nUmVkaXJlY3RVcmkiOiIiLCJib29raW5nQ2FuY2VsUmVkaXJlY3RVcmkiOiIiLCJib29raW5nUmVzY2hlZHVsZVJlZGlyZWN0VXJpIjoiIiwiYXJlRW1haWxzRW5hYmxlZCI6dHJ1ZSwiaWF0IjoxNzE5NTk1ODA4fQ.L5_jSS14fcKLCD_9_DAOgtGd6lUSZlU5CEpCPaPt41I" \
-d '{
"name": "Test Workflow - Booking Confirmation",
"activation": {
"isActiveOnAllEventTypes": false,
"activeOnEventTypeIds": [1173]
},
"trigger": {
"type": "newEvent"
},
"steps": [
{
"action": "email_attendee",
"stepNumber": 1,
"sender": "Cal.com",
"includeCalendarEvent": true,
"message": {
"subject": "Booking Confirmation: {EVENT_NAME}",
"html": "<p>Hi {ATTENDEE},</p><p>This is a confirmation for your booking of {EVENT_NAME} with {ORGANIZER}.</p><p><strong>Date & Time:</strong> {EVENT_DATE_ddd, MMM D, YYYY h:mma} ({TIMEZONE})</p><p><strong>Location:</strong> {LOCATION}</p><p>Looking forward to meeting you!</p>"
}
}
]
}'
I made a booking and the email no longer has cal.com branding:

I then created a workflow that is sent 10 minutes before the event:
curl -X POST "http://localhost:5555/api/v2/organizations/1/teams/19/workflows" \
-H "Content-Type: application/json" \
-H "x-cal-client-id: clxyyy21o0003sbk7yw5z6tzg" \
-H "x-cal-secret-key: eyJuYW1lIjoiQWNtZSAiLCJwZXJtaXNzaW9ucyI6MTAyMywicmVkaXJlY3RVcmlzIjpbImh0dHA6Ly9sb2NhbGhvc3Q6NDMyMSJdLCJib29raW5nUmVkaXJlY3RVcmkiOiIiLCJib29raW5nQ2FuY2VsUmVkaXJlY3RVcmkiOiIiLCJib29raW5nUmVzY2hlZHVsZVJlZGlyZWN0VXJpIjoiIiwiYXJlRW1haWxzRW5hYmxlZCI6dHJ1ZSwiaWF0IjoxNzE5NTk1ODA4fQ.L5_jSS14fcKLCD_9_DAOgtGd6lUSZlU5CEpCPaPt41I" \
-d '{
"name": "Test Workflow - Before Event Reminder",
"activation": {
"isActiveOnAllEventTypes": false,
"activeOnEventTypeIds": [1173]
},
"trigger": {
"type": "beforeEvent",
"offset": {
"value": 1,
"unit": "day"
}
},
"steps": [
{
"action": "email_attendee",
"stepNumber": 1,
"sender": "Cal.com",
"includeCalendarEvent": true,
"message": {
"subject": "Reminder: {EVENT_NAME} starting soon",
"html": "<p>Hi {ATTENDEE},</p><p>This is a reminder that your booking of {EVENT_NAME} with {ORGANIZER} is starting soon.</p><p><strong>Date & Time:</strong> {EVENT_DATE_ddd, MMM D, YYYY h:mma} ({TIMEZONE})</p><p><strong>Location:</strong> {LOCATION}</p><p>See you there!</p>"
}
}
]
}'
and then made booking and triggered the cron job and the email does not have cal branding:

Problem
One of our platform customers has reported that the reminder emails sent by the workflow still have cal.com branding. We already hide cal.com branding at the bottom when sending scheduled meeting emails on behalf of platform customers in BaseScheduledEmail.tsx
Solution
When a sending email reminder via workflow for a booking that belongs to a managed user which is tied to a specific PlatformOAuth client, then hide footer.
Remove cal.com branding for all platform OAuth clients all workflow emails.
Implementation
platformClientIdin booking metadata in the old controller 2024-04-15/controllers/bookings.controller.ts and in the new controller's service 2024-08-13/services/input.service.ts. Reflect this in the schema prisma/zod-utils.ts. We need to storeplatformClientIdfor workflows that are triggered by tasked later at some point - they only have booking uid available so then they need to know whether or not to disable branding.platformClientIdin the booking's metadata and if it is defined setsisBrandingDisabledto true.platformClientIdto calendar event builder which attachesplatformClientIdto event created that then is accessed by the EmailWorkflowService.ts to decide whether or not to hide branding.platformClientIdis provided. Notably, we don't need to accessplatformClientIdfor immediate workflows because we knowplatformClientIdalready.Test
For a platform team i created a workflow trigger that sends an email when event is scheduled:
I made a booking and the email no longer has cal.com branding:
I then created a workflow that is sent 10 minutes before the event:
and then made booking and triggered the cron job and the email does not have cal branding: