Skip to content

fix(zohocalendar): suppress Zoho notification emails#29600

Draft
RussianCow wants to merge 1 commit into
calcom:mainfrom
RussianCow:zoho-no-notification
Draft

fix(zohocalendar): suppress Zoho notification emails#29600
RussianCow wants to merge 1 commit into
calcom:mainfrom
RussianCow:zoho-no-notification

Conversation

@RussianCow

Copy link
Copy Markdown

What does this PR do?

Suppress Zoho Calendar event notification emails so that two emails are not sent with every booking.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Install and enable the Zoho Calendar integration.
  • Create an event type using a Zoho calendar as the primary calendar.
  • Book an event. You should only receive the confirmation email from Cal.com, not one from Zoho.

@github-actions github-actions Bot added the 🐛 bug Something isn't working label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @RussianCow! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The deleteEvent method in ZohoCalendarService is updated to include an eventdata query parameter in the DELETE request, containing the event uid and notify_attendee: 0. The translateEvent method has its reminders array closure adjusted so that notify_attendee: 0 is consistently set immediately after the reminders definition in the returned payload. A new Vitest test file is added covering createEvent, updateEvent, and deleteEvent, asserting that all three operations include notify_attendee: 0 in their outgoing Zoho Calendar API requests.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective: suppressing Zoho notification emails to prevent duplicate emails when events are booked.
Description check ✅ Passed The description is well-related to the changeset, explaining what the PR does, linking to the relevant issue, and providing clear testing instructions.
Linked Issues check ✅ Passed The code changes directly address issue #29592 by implementing the requested suppression logic: deleteEvent, updateEvent, and createEvent now all set notify_attendee: 0 in Zoho requests to suppress notification emails.
Out of Scope Changes check ✅ Passed All changes are directly scoped to suppressing Zoho notifications as specified in #29592; modifications to CalendarService.ts and addition of comprehensive tests are both within scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts (1)

169-176: ⚡ Quick win

Assert the DELETE etag header in this test.

This test verifies notify_attendee, but it should also assert the forwarded etag since delete now depends on it.

Suggested patch
       const deleteCall = fetchMock.mock.calls[1] as [string, RequestInit];
       const [requestUrl, requestInit] = deleteCall;
       expect(requestUrl).toContain(`/calendars/849d6badb4e04acc91860c43db0fb109/events/${mockEventUid}`);
       expect(requestInit.method).toBe("DELETE");
+      expect(requestInit.headers as Record<string, string>).toMatchObject({
+        etag: "1669788841981",
+      });

       const eventData = parseEventDataFromRequestUrl(requestUrl);
       expect(eventData.notify_attendee).toBe(0);
       expect(eventData.uid).toBe(mockEventUid);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts` around
lines 169 - 176, Add an assertion to verify that the etag header is forwarded in
the DELETE request. After the existing assertions that check requestInit.method,
notify_attendee, and uid, add a new assertion to verify that the etag header is
present in the requestInit.headers object. This ensures the delete operation has
the required etag dependency that the code now relies on.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts`:
- Around line 169-176: Add an assertion to verify that the etag header is
forwarded in the DELETE request. After the existing assertions that check
requestInit.method, notify_attendee, and uid, add a new assertion to verify that
the etag header is present in the requestInit.headers object. This ensures the
delete operation has the required etag dependency that the code now relies on.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af92b78b-e72f-4bff-850f-cd5a077d8dd5

📥 Commits

Reviewing files that changed from the base of the PR and between 561cf88 and ba2d832.

📒 Files selected for processing (2)
  • packages/app-store/zohocalendar/lib/CalendarService.ts
  • packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts

@bandhan-majumder bandhan-majumder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hey @RussianCow , can u please add a visual demo for this? Making it draft til then

@bandhan-majumder bandhan-majumder marked this pull request as draft June 17, 2026 20:27
@RussianCow

Copy link
Copy Markdown
Author

@bandhan-majumder Sure! What would you like me to demo, exactly? Receiving two separate emails for a booking?

@bandhan-majumder

Copy link
Copy Markdown
Member

the expected result as u mentioned in the issue: You only receive the confirmation email from the Cal platform. You can use mailpit. it would be running in localhost:8025 automatically when u run the repo locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zoho Calendar notification email isn't suppressed

2 participants