feat: Disable booking emails to guests (#25217)

* feat: disable SMS org setting

* chore: undo

* fix: cal evnet

* feat: add more settings

* tests: add email manager unit tests

* fix: update

* fix: type error

* fix: test

* refactor: UI

* refactor: UI

* perf: fetch only once

* perf: fetch only once

* chore: use org

* fix: test

* test: add unit tests

* refactor: email manager

* fix: add confirmation dialog for individual checkbox

* fix: sms

* chore: common.json
This commit is contained in:
Udit Takkar authored and GitHub committed 2025-12-03 17:21:31 +00:00
1 parent 1c3ced5b70
commit 35d6c41fff
32 files changed
+936 -27

No files matched your search

@@ -91,6 +91,10 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
href: "/settings/organizations/general",
trackingMetadata: { section: "organization", page: "general" },
},
{
name: "guest_notifications",
href: "/settings/organizations/guest-notifications",
},
...(orgBranding
? [
{
@@ -0,0 +1,55 @@
import { _generateMetadata, getTranslate } from "app/_utils";
import { redirect } from "next/navigation";
import GuestNotificationsView from "@calcom/features/ee/organizations/pages/settings/guest-notifications";
import { Resource } from "@calcom/features/pbac/domain/types/permission-registry";
import { getResourcePermissions } from "@calcom/features/pbac/lib/resource-permissions";
import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader";
import { MembershipRole } from "@calcom/prisma/enums";
import { validateUserHasOrg } from "../../actions/validateUserHasOrg";
export const generateMetadata = async () =>
await _generateMetadata(
(t) => t("guest_notifications"),
(t) => t("guest_notifications_description"),
undefined,
undefined,
"/settings/organizations/guest-notifications"
);
const Page = async () => {
const session = await validateUserHasOrg();
const t = await getTranslate();
if (!session?.user.id || !session?.user.profile?.organizationId || !session?.user.org) {
return redirect("/settings/profile");
}
const { canRead, canEdit } = await getResourcePermissions({
userId: session.user.id,
teamId: session.user.profile.organizationId,
resource: Resource.Organization,
userRole: session.user.org.role,
fallbackRoles: {
read: {
roles: [MembershipRole.MEMBER, MembershipRole.ADMIN, MembershipRole.OWNER],
},
update: {
roles: [MembershipRole.ADMIN, MembershipRole.OWNER],
},
},
});
if (!canRead) {
return redirect("/settings/profile");
}
return (
<SettingsHeader title={t("guest_notifications")} description={t("guest_notifications_description")}>
<GuestNotificationsView permissions={{ canRead, canEdit }} />
</SettingsHeader>
);
};
export default Page;
@@ -308,6 +308,8 @@
"guest": "Guest",
"web_conferencing_details_to_follow": "Web conferencing details to follow in the confirmation email.",
"confirmation": "Confirmation",
"cancellation": "Cancellation",
"request": "Request",
"what_booker_should_provide": "What your booker should provide to receive confirmations",
"404_the_user": "The username",
"username": "Username",
@@ -3932,6 +3934,37 @@
"no_description_provided": "No description provided",
"organization_blocklist": "Organization Blocklist",
"manage_blocked_emails_and_domains": "Manage blocked emails and domains for your organization",
"guest_notifications": "Guest Notifications",
"guest_notifications_description": "Manage guest booking emails across all event types in your organization",
"guest_booking_email_notifications": "Guest Booking Email Notifications",
"guest_booking_email_notifications_description": "Manage which booking emails are sent to guests across all event types in your organization",
"disable_guest_emails_warning": "These settings control important booking emails to keep your guests updated. They apply to all event types in your organization. If you disable emails, we recommend setting up org-wide workflows instead.",
"disable_all_booking_emails_to_guests": "Disable all booking emails to guests",
"disable_all": "Disable All",
"enable_all": "Enable All",
"disable_all_booking_emails_to_guests_description": "When enabled, guests will not receive any booking-related emails. This does not affect Workflow emails.",
"disable_all_guest_booking_emails_confirm_title": "Are you sure you want to disable all booking emails?",
"disable_all_guest_booking_emails_confirm_description": "This will prevent guests from receiving important booking updates across all event types in your organization. We recommend setting up custom org-wide workflow.",
"enable_all_guest_booking_emails_confirm_title": "Are you sure you want to enable all booking emails?",
"enable_all_guest_booking_emails_confirm_description": "This will allow guests to receive all booking-related email notifications across all event types in your organization.",
"disable_individual_guest_email_confirm_title": "Are you sure you want to disable {{emailType}} emails?",
"disable_individual_guest_email_confirm_description": "This will prevent guests from receiving {{emailType}} emails across all event types in your organization. We recommend setting up a custom org-wide Workflow for this.",
"email_type": "Email Type",
"guest_confirmation_email_description": "Email sent when booking is created",
"guest_cancellation_email_description": "Email sent when booking is cancelled",
"guest_rescheduled_email_description": "Email sent when booking is rescheduled",
"guest_request_email_description": "Email sent when booking is requested",
"attendee_request_email_description": "Email sent when booking is requested or declined",
"attendee_reassigned_email_description": "Email sent when host is reassigned for the booking",
"attendee_awaiting_payment_email_description": "Email sent when payment is pending",
"attendee_reschedule_request_email_description": "Email sent when organizer requests attendee to reschedule",
"attendee_location_change_email_description": "Email sent when meeting location is updated",
"attendee_new_event_email_description": "Email sent to existing attendees when new guests are added",
"host_reassignment": "Host Reassignment",
"awaiting_payment": "Awaiting Payment",
"reschedule_request": "Reschedule Request",
"location_change": "Location Change",
"guest_added": "Guest Added",
"invalid_domain_format": "Invalid domain format. Example: example.com",
"invalid_email_address": "Invalid email address. Example: [email protected]",
"reason_for_adding_to_blocklist": "Reason for adding to blocklist",