feat: new workflow variable booking title#24308
Conversation
|
@dhairyashiil is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds a new workflow variable for booking title across reminder templates. The custom template VariablesType now includes an optional bookingTitle and replaces {BOOKING_TITLE} in template text. Email and SMS reminder scheduling pass bookingTitle into template variables; WhatsApp reminder uses reminder.booking.title as the eventName source. DYNAMIC_TEXT_VARIABLES now includes "booking_title". No control-flow changes. Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.ts📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx,js,jsx}⚙️ CodeRabbit configuration file
Files:
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
packages/features/ee/workflows/api/scheduleEmailReminders.ts(1 hunks)packages/features/ee/workflows/api/scheduleSMSReminders.ts(1 hunks)packages/features/ee/workflows/api/scheduleWhatsappReminders.ts(2 hunks)packages/features/ee/workflows/lib/constants.ts(1 hunks)packages/features/ee/workflows/lib/reminders/emailReminderManager.ts(1 hunks)packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/features/ee/workflows/api/scheduleSMSReminders.tspackages/features/ee/workflows/api/scheduleEmailReminders.tspackages/features/ee/workflows/lib/reminders/emailReminderManager.tspackages/features/ee/workflows/lib/constants.tspackages/features/ee/workflows/api/scheduleWhatsappReminders.tspackages/features/ee/workflows/lib/reminders/templates/customTemplate.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/features/ee/workflows/api/scheduleSMSReminders.tspackages/features/ee/workflows/api/scheduleEmailReminders.tspackages/features/ee/workflows/lib/reminders/emailReminderManager.tspackages/features/ee/workflows/lib/constants.tspackages/features/ee/workflows/api/scheduleWhatsappReminders.tspackages/features/ee/workflows/lib/reminders/templates/customTemplate.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/features/ee/workflows/api/scheduleSMSReminders.tspackages/features/ee/workflows/api/scheduleEmailReminders.tspackages/features/ee/workflows/lib/reminders/emailReminderManager.tspackages/features/ee/workflows/lib/constants.tspackages/features/ee/workflows/api/scheduleWhatsappReminders.tspackages/features/ee/workflows/lib/reminders/templates/customTemplate.ts
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Install dependencies / Yarn install & cache
🔇 Additional comments (6)
packages/features/ee/workflows/lib/constants.ts (1)
78-78: LGTM!The addition of "booking_title" to the DYNAMIC_TEXT_VARIABLES array correctly exposes the new workflow variable for use in templates.
packages/features/ee/workflows/api/scheduleEmailReminders.ts (1)
202-202: LGTM!The bookingTitle variable is correctly added to the email template variables, sourced from
reminder.booking.title, which aligns with the PR objective to expose the booking title in workflow templates.packages/features/ee/workflows/lib/reminders/emailReminderManager.ts (1)
143-143: LGTM!The bookingTitle is correctly initialized from
evt.titlewith a safe fallback to an empty string, following the same pattern as eventName on line 142.packages/features/ee/workflows/api/scheduleWhatsappReminders.ts (1)
84-84: Verify the behavioral change for WhatsApp reminders.The event source for WhatsApp reminders has been changed from
reminder.booking?.eventType?.titletoreminder.booking.titleon lines 84 and 98. This aligns with the PR objective to use the booking title, but please confirm this behavioral change is intentional and that existing WhatsApp reminders will display the expected title.Also applies to: 98-98
packages/features/ee/workflows/api/scheduleSMSReminders.ts (1)
151-151: LGTM!The bookingTitle variable is correctly added to the SMS template variables, consistent with the email implementation.
packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts (1)
31-31: LGTM!The optional
bookingTitlefield is correctly added to the VariablesType interface.
packages/features/ee/workflows/lib/reminders/templates/customTemplate.ts
Outdated
Show resolved
Hide resolved
pallava-joshi
left a comment
There was a problem hiding this comment.
tested locally. working fine
E2E results are ready! |
| name: userName, | ||
| attendeeName: attendeeName || "", | ||
| eventName: reminder.booking?.eventType?.title, | ||
| eventName: reminder.booking.title, |
There was a problem hiding this comment.
Going to request changes here to get feedback from @CarinaWolli on whether overwriting this value is what we wanted versus another new one
CarinaWolli
left a comment
There was a problem hiding this comment.
I think we need to solve this differently.
At the moment {EVENT_NAME} uses the value from evt.title in almost all places. And evt.title is already the booking title (it's not the event type title).
So I think we should start with changing the description to "The booking title"

We only use eventName: reminder.booking.eventType?.title || "", in the cron endpoints, but they are deprecated and not used anymore
@dhairyashiil before implementing this, could you double check if this is correct?
Yes I checked it. You are right, it’s the booking title. As you said, I reverted the changes and, for now, only updated the description of the event name variable to ‘The booking title’. |
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="apps/web/public/static/locales/en/common.json">
<violation number="1" location="apps/web/public/static/locales/en/common.json:1759">
This PR introduces the concept of a `booking title`, but the feature is incomplete. The Prisma query in `packages/features/ee/workflows/lib/getWorkflowReminders.ts` does not select the `title` field from the `Booking` model. Code that consumes this data in `scheduleEmailReminders.ts` expects `booking.title` to exist, but it will be undefined, causing the feature to silently fail.</violation>
<violation number="2" location="apps/web/public/static/locales/en/common.json:1759">
The i18n key `event_name_info` was changed to "The booking title", but this key is used in `packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.tsx` where it describes an event type name. This change introduces inconsistent and incorrect text in the UI. A new i18n key should be created for "booking title" to avoid this cross-file conflict.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| "email_subject": "Email subject", | ||
| "add_dynamic_variables": "Add dynamic text variables", | ||
| "event_name_info": "The event type name", | ||
| "event_name_info": "The booking title", |
There was a problem hiding this comment.
This PR introduces the concept of a booking title, but the feature is incomplete. The Prisma query in packages/features/ee/workflows/lib/getWorkflowReminders.ts does not select the title field from the Booking model. Code that consumes this data in scheduleEmailReminders.ts expects booking.title to exist, but it will be undefined, causing the feature to silently fail.
Prompt for AI agents
Address the following comment on apps/web/public/static/locales/en/common.json at line 1759:
<comment>This PR introduces the concept of a `booking title`, but the feature is incomplete. The Prisma query in `packages/features/ee/workflows/lib/getWorkflowReminders.ts` does not select the `title` field from the `Booking` model. Code that consumes this data in `scheduleEmailReminders.ts` expects `booking.title` to exist, but it will be undefined, causing the feature to silently fail.</comment>
<file context>
@@ -1756,7 +1756,7 @@
"email_subject": "Email subject",
"add_dynamic_variables": "Add dynamic text variables",
- "event_name_info": "The event type name",
+ "event_name_info": "The booking title",
"event_date_info": "The event date",
"event_duration_info": "The event duration",
</file context>
| "email_subject": "Email subject", | ||
| "add_dynamic_variables": "Add dynamic text variables", | ||
| "event_name_info": "The event type name", | ||
| "event_name_info": "The booking title", |
There was a problem hiding this comment.
The i18n key event_name_info was changed to "The booking title", but this key is used in packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.tsx where it describes an event type name. This change introduces inconsistent and incorrect text in the UI. A new i18n key should be created for "booking title" to avoid this cross-file conflict.
Prompt for AI agents
Address the following comment on apps/web/public/static/locales/en/common.json at line 1759:
<comment>The i18n key `event_name_info` was changed to "The booking title", but this key is used in `packages/features/eventtypes/components/tabs/advanced/CustomEventTypeModal.tsx` where it describes an event type name. This change introduces inconsistent and incorrect text in the UI. A new i18n key should be created for "booking title" to avoid this cross-file conflict.</comment>
<file context>
@@ -1756,7 +1756,7 @@
"email_subject": "Email subject",
"add_dynamic_variables": "Add dynamic text variables",
- "event_name_info": "The event type name",
+ "event_name_info": "The booking title",
"event_date_info": "The event date",
"event_duration_info": "The event duration",
</file context>
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/web/public/static/locales/en/common.json">
<violation number="1" location="apps/web/public/static/locales/en/common.json:1759">
This change introduces a UI inconsistency. The variable `{Event type title}` is now described as "The booking title", but its name and underlying logic still refer to the event type's title. This will mislead users trying to customize event names.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| "email_subject": "Email subject", | ||
| "add_dynamic_variables": "Add dynamic text variables", | ||
| "event_name_info": "The event type name", | ||
| "event_name_info": "The booking title", |
There was a problem hiding this comment.
This change introduces a UI inconsistency. The variable {Event type title} is now described as "The booking title", but its name and underlying logic still refer to the event type's title. This will mislead users trying to customize event names.
Prompt for AI agents
Address the following comment on apps/web/public/static/locales/en/common.json at line 1759:
<comment>This change introduces a UI inconsistency. The variable `{Event type title}` is now described as "The booking title", but its name and underlying logic still refer to the event type's title. This will mislead users trying to customize event names.</comment>
<file context>
@@ -1756,7 +1756,7 @@
"email_subject": "Email subject",
"add_dynamic_variables": "Add dynamic text variables",
- "event_name_info": "The event type name",
+ "event_name_info": "The booking title",
"event_date_info": "The event date",
"event_duration_info": "The event duration",
</file context>
What does this PR do?
Visual Demo
New.workflow.variable.for.the.booking.title.main.mov