Skip to content

Scheduling infrastructure for absolutely everyone.

fix: translate (#9108)

Nafees Nazikabc9dfdaf47e
diff --git a/packages/emails/src/templates/AttendeeWasRequestedToRescheduleEmail.tsx b/packages/emails/src/templates/AttendeeWasRequestedToRescheduleEmail.tsx
index 256e77596b8..fe45ce2acab 100644
--- a/packages/emails/src/templates/AttendeeWasRequestedToRescheduleEmail.tsx
+++ b/packages/emails/src/templates/AttendeeWasRequestedToRescheduleEmail.tsx
@@ -3,23 +3,27 @@ import { OrganizerScheduledEmail } from "./OrganizerScheduledEmail";
export const AttendeeWasRequestedToRescheduleEmail = (
props: { metadata: { rescheduleLink: string } } & React.ComponentProps<typeof OrganizerScheduledEmail>
-) => (
- <OrganizerScheduledEmail
- title="request_reschedule_title_attendee"
- subtitle={
- <>
- {props.calEvent.organizer.language.translate("request_reschedule_subtitle", {
- organizer: props.calEvent.organizer.name,
- })}
- </>
- }
- headerType="calendarCircle"
- subject="rescheduled_event_type_subject"
- callToAction={
- <CallToActionTable>
- <CallToAction label="Book a new time" href={props.metadata.rescheduleLink} endIconName="linkIcon" />
- </CallToActionTable>
- }
- {...props}
- />
-);
+) => {
+ const t = props.attendee.language.translate;
+ return (
+ <OrganizerScheduledEmail
+ t={t}
+ title="request_reschedule_title_attendee"
+ subtitle={
+ <>
+ {t("request_reschedule_subtitle", {
+ organizer: props.calEvent.organizer.name,
+ })}
+ </>
+ }
+ headerType="calendarCircle"
+ subject="rescheduled_event_type_subject"
+ callToAction={
+ <CallToActionTable>
+ <CallToAction label="Book a new time" href={props.metadata.rescheduleLink} endIconName="linkIcon" />
+ </CallToActionTable>
+ }
+ {...props}
+ />
+ );
+};
diff --git a/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts b/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts
index 6b4ca01e828..881c9890e5e 100644
--- a/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts
+++ b/packages/emails/templates/attendee-was-requested-to-reschedule-email.ts
@@ -1,10 +1,10 @@
-import type { DateArray, Person } from "ics";
+import type { DateArray } from "ics";
import { createEvent } from "ics";
import dayjs from "@calcom/dayjs";
import { getManageLink } from "@calcom/lib/CalEventParser";
import { APP_NAME } from "@calcom/lib/constants";
-import type { CalendarEvent } from "@calcom/types/Calendar";
+import type { CalendarEvent, Person } from "@calcom/types/Calendar";
import { renderEmail } from "..";
import OrganizerScheduledEmail from "./organizer-scheduled-email";
@@ -14,6 +14,7 @@ export default class AttendeeWasRequestedToRescheduleEmail extends OrganizerSche
constructor(calEvent: CalendarEvent, metadata: { rescheduleLink: string }) {
super({ calEvent });
this.metadata = metadata;
+ this.t = this.calEvent.attendees[0].language.translate;
}
protected getNodeMailerPayload(): Record<string, unknown> {
const toAddresses = [this.calEvent.attendees[0].email];
@@ -31,7 +32,7 @@ export default class AttendeeWasRequestedToRescheduleEmail extends OrganizerSche
})}`,
html: renderEmail("AttendeeWasRequestedToRescheduleEmail", {
calEvent: this.calEvent,
- attendee: this.calEvent.organizer,
+ attendee: this.calEvent.attendees[0],
metadata: this.metadata,
}),
text: this.getTextBody(),