-
Notifications
You must be signed in to change notification settings - Fork 12k
fix: respect hideCalendarNotes setting during booking reschedule
#25945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f256e29
260bc00
c34698a
88ab60e
69224b3
fb146d5
3fad582
caa6960
d7d44fe
cbf8d7f
0fa0758
5c94afd
646a503
1a97f5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,7 +212,18 @@ export const sendRoundRobinRescheduledEmailsAndSMS = async ( | |
| if ( | ||
| !shouldSkipAttendeeEmailWithSettings(eventTypeMetadata, organizationSettings, EmailType.RESCHEDULED) | ||
| ) { | ||
| emailsAndSMSToSend.push(sendEmail(() => new AttendeeRescheduledEmail(calendarEvent, person))); | ||
| emailsAndSMSToSend.push( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not a breaking change or change in logic, it was simply missing for the rescheduling logic. if you checkout line 395 of email manager here we were already implementing this when create a new booking, it was simply missing when rescheduling |
||
| sendEmail( | ||
| () => | ||
| new AttendeeRescheduledEmail( | ||
| { | ||
| ...calendarEvent, | ||
| ...(calendarEvent.hideCalendarNotes && { additionalNotes: undefined }), | ||
| }, | ||
| person | ||
| ) | ||
| ) | ||
| ); | ||
| if (person.phoneNumber) { | ||
| emailsAndSMSToSend.push(successfullyReScheduledSMS.sendSMSToAttendee(person)); | ||
| } | ||
|
|
@@ -322,7 +333,16 @@ const _sendRescheduledEmailsAndSMS = async ( | |
| if (!shouldSkipAttendeeEmailWithSettings(eventTypeMetadata, organizationSettings, EmailType.RESCHEDULED)) { | ||
| emailsToSend.push( | ||
| ...calendarEvent.attendees.map((attendee) => { | ||
| return sendEmail(() => new AttendeeRescheduledEmail(calendarEvent, attendee)); | ||
| return sendEmail( | ||
| () => | ||
| new AttendeeRescheduledEmail( | ||
| { | ||
| ...calendarEvent, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above, missing logic |
||
| ...(calendarEvent.hideCalendarNotes && { additionalNotes: undefined }), | ||
| }, | ||
| attendee | ||
| ) | ||
| ); | ||
| }) | ||
| ); | ||
| } | ||
|
|
@@ -350,7 +370,18 @@ export const sendRescheduledSeatEmailAndSMS = async ( | |
| if (!eventTypeDisableHostEmail(eventTypeMetadata)) | ||
| emailsToSend.push(sendEmail(() => new OrganizerRescheduledEmail({ calEvent: calendarEvent }))); | ||
| if (!shouldSkipAttendeeEmailWithSettings(eventTypeMetadata, organizationSettings, EmailType.RESCHEDULED)) | ||
| emailsToSend.push(sendEmail(() => new AttendeeRescheduledEmail(clonedCalEvent, attendee))); | ||
| emailsToSend.push( | ||
| sendEmail( | ||
| () => | ||
| new AttendeeRescheduledEmail( | ||
| { | ||
| ...clonedCalEvent, | ||
| ...(clonedCalEvent.hideCalendarNotes && { additionalNotes: undefined }), | ||
| }, | ||
| attendee | ||
| ) | ||
| ) | ||
| ); | ||
|
|
||
| const successfullyReScheduledSMS = new EventSuccessfullyReScheduledSMS(calEvent); | ||
| await successfullyReScheduledSMS.sendSMSToAttendee(attendee); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2094,6 +2094,10 @@ async function handler( | |
| }); | ||
| } | ||
| } | ||
| // This gets overridden when updating the event - to check if notes have been hidden or not. We just reset this back | ||
| // to the default description when we are sending the emails. | ||
| evt.description = eventType.description; | ||
Ryukemeister marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because |
||
|
|
||
| const updateManager = !skipCalendarSyncTaskCreation | ||
| ? await eventManager.reschedule( | ||
| evt, | ||
|
|
@@ -2105,9 +2109,6 @@ async function handler( | |
| skipDeleteEventsAndMeetings | ||
| ) | ||
| : placeholderCreatedEvent; | ||
| // This gets overridden when updating the event - to check if notes have been hidden or not. We just reset this back | ||
| // to the default description when we are sending the emails. | ||
| evt.description = eventType.description ?? evt.description; | ||
|
|
||
| results = updateManager.results; | ||
| referencesToCreate = updateManager.referencesToCreate; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -388,6 +388,11 @@ export const updateEvent = async ( | |
| externalCalendarId: string | null | ||
| ): Promise<EventResult<NewCalendarEventType>> => { | ||
| const formattedEvent = formatCalEvent(rawCalEvent); | ||
|
|
||
| if (formattedEvent.hideCalendarNotes) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is again not a logic change or breaking change, it was simply missing for rescheduling logic. if you checkout line 308 of the same function here its already present for create booking, it was simply missing for rescheduling |
||
| formattedEvent.additionalNotes = "Notes have been hidden by the organizer"; // TODO: i18n this string? | ||
| } | ||
|
|
||
| const calEvent = processEvent(formattedEvent); | ||
| const uid = getUid(calEvent); | ||
| const calendar = await getCalendar(credential, "booking"); | ||
|
|
@@ -500,7 +505,7 @@ export const deleteEvent = async ({ | |
| * Process the calendar event by generating description and removing attendees if needed | ||
| */ | ||
| const processEvent = (calEvent: CalendarEvent): CalendarServiceEvent => { | ||
| if (calEvent.seatsPerTimeSlot){ | ||
| if (calEvent.seatsPerTimeSlot) { | ||
| calEvent.responses = null; | ||
| calEvent.userFieldsResponses = null; | ||
| calEvent.additionalNotes = null; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not being anywhere right now, its for later