fix: translate (#9108)

gh-readonly-queue/main/pr-8884-abc9dfdaf47ec67a903c2809679a46ec15571ade
Nafees Nazik 2023-05-25 21:20:56 +05:30 committed by GitHub
parent bbf93a7435
commit abc9dfdaf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 23 deletions

View File

@ -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}
/>
);
};

View File

@ -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(),