Skip to content

fix(emails): preserve 24h format in attendee confirmation emails#28494

Open
abdulbaqui17 wants to merge 1 commit intocalcom:mainfrom
abdulbaqui17:fix-28472-attendee-time-format
Open

fix(emails): preserve 24h format in attendee confirmation emails#28494
abdulbaqui17 wants to merge 1 commit intocalcom:mainfrom
abdulbaqui17:fix-28472-attendee-time-format

Conversation

@abdulbaqui17
Copy link

Summary

Fixes attendee (scheduler/booker) confirmation emails showing 12-hour time when the booking was made in 24-hour format.

Root Cause

Attendee scheduled emails rely on attendee.timeFormat, but in this flow it can be missing. The template then falls back to 12-hour format by default.

Fix

  • In attendee scheduled email rendering, if attendee.timeFormat is missing, fallback to calEvent.organizer.timeFormat.
  • This preserves the booking's chosen/host-applied time format for attendee confirmations.

Tests

  • Added regression test to assert attendee scheduled email render payload receives 24-hour timeFormat when attendee time format is absent and organizer uses 24-hour format.
  • Ran:
    • TZ=UTC yarn vitest run packages/emails/email-manager.test.ts

Scope

  • Minimal change in email formatting path only.
  • No API/schema changes.

Closes #28472

Copilot AI review requested due to automatic review settings March 19, 2026 02:58
@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 19, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes attendee (booker) confirmation emails rendering times in 12-hour format when the booking/host uses 24-hour format, by ensuring the attendee payload passed to the email template includes a proper timeFormat fallback.

Changes:

  • Add a fallback in AttendeeScheduledEmail.getHtml to use calEvent.organizer.timeFormat when attendee.timeFormat is missing.
  • Add a regression test asserting the attendee render payload receives TWENTY_FOUR_HOUR when the organizer uses 24-hour format and attendee time format is absent.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/emails/templates/attendee-scheduled-email.ts Ensures attendee template props include a timeFormat fallback to organizer preference.
packages/emails/email-manager.test.ts Adds a regression test to validate the time format fallback behavior in the render payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import { TimeFormat } from "@calcom/lib/timeFormat";
import type { CalendarEvent, Person } from "@calcom/types/Calendar";

import { shouldSkipAttendeeEmailWithSettings, fetchOrganizationEmailSettings } from "./email-manager";
Comment on lines +412 to +421
describe("AttendeeScheduledEmail - Time format fallback", () => {
const createMockPerson = (name: string, email: string): Person => ({
name,
email,
timeZone: "America/New_York",
language: {
translate: vi.fn((key: string) => key),
locale: "en",
},
});
Copy link
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.

No issues found across 2 files

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

time format wrong in scheduler confirmation email

3 participants