Skip to content

fix: respect disableStandardEmails setting for cancellation emails#26681

Closed
AyushMhaisane wants to merge 2 commits intocalcom:mainfrom
AyushMhaisane:fix/issue-26417-cancellation-email
Closed

fix: respect disableStandardEmails setting for cancellation emails#26681
AyushMhaisane wants to merge 2 commits intocalcom:mainfrom
AyushMhaisane:fix/issue-26417-cancellation-email

Conversation

@AyushMhaisane
Copy link
Copy Markdown

Fixes #26417

Description

Currently, the BookingCancelledEmail is sent even when the "Disable default emails" setting is enabled in the Event Type.

This PR adds a check for eventType.metadata.disableStandardEmails in handleCancelBooking.ts. If this setting is true, the default cancellation email will be skipped.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  1. Create an Event Type and enable "Disable default emails" in the Advanced settings.
  2. Book a meeting for this event type.
  3. Cancel the meeting.
  4. Verify that the Booker and Organizer do NOT receive the default cancellation email.

@AyushMhaisane AyushMhaisane requested a review from a team as a code owner January 10, 2026 07:35
@graphite-app graphite-app Bot added the community Created by Linear-GitHub Sync label Jan 10, 2026
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 10, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the 🐛 bug Something isn't working label Jan 10, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/bookings/lib/handleCancelBooking.ts">

<violation number="1" location="packages/features/bookings/lib/handleCancelBooking.ts:693">
P1: The `disableStandardEmails` check is incorrect. This field is an object with nested `all` and `confirmation` properties (each with `host` and `attendee` booleans), not a simple boolean. Checking `!disableStandardEmails` will only be true when the object is undefined, not when the user has enabled the setting. Consider checking `disableStandardEmails?.all?.host` and `disableStandardEmails?.all?.attendee` separately for host and attendee cancellation emails.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

const eventTypeMetadata = bookingToDelete?.eventType?.metadata as EventTypeMetadata;
const disableStandardEmails = eventTypeMetadata?.disableStandardEmails;

if (!disableStandardEmails) {
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The disableStandardEmails check is incorrect. This field is an object with nested all and confirmation properties (each with host and attendee booleans), not a simple boolean. Checking !disableStandardEmails will only be true when the object is undefined, not when the user has enabled the setting. Consider checking disableStandardEmails?.all?.host and disableStandardEmails?.all?.attendee separately for host and attendee cancellation emails.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/bookings/lib/handleCancelBooking.ts, line 693:

<comment>The `disableStandardEmails` check is incorrect. This field is an object with nested `all` and `confirmation` properties (each with `host` and `attendee` booleans), not a simple boolean. Checking `!disableStandardEmails` will only be true when the object is undefined, not when the user has enabled the setting. Consider checking `disableStandardEmails?.all?.host` and `disableStandardEmails?.all?.attendee` separately for host and attendee cancellation emails.</comment>

<file context>
@@ -687,13 +687,19 @@ async function handler(input: CancelBookingInput) {
+    const eventTypeMetadata = bookingToDelete?.eventType?.metadata as EventTypeMetadata;
+    const disableStandardEmails = eventTypeMetadata?.disableStandardEmails;
+
+    if (!disableStandardEmails) {
+      // TODO: if emails fail try to requeue them
+      if (!platformClientId || (platformClientId && arePlatformEmailsEnabled)) {
</file context>

✅ Addressed in 864f372

@anikdhabal
Copy link
Copy Markdown
Contributor

Thanks for your work. Check this:- #26417 (comment)

@anikdhabal anikdhabal closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standard email upon cancellation despite workflow

3 participants