Skip to content

Scheduling infrastructure for absolutely everyone.

fix: organizer/attendee timezones in emails (#543)

Mihai C1ab9d1797a0e
diff --git a/lib/emails/EventAttendeeMail.ts b/lib/emails/EventAttendeeMail.ts
index 12d3d80debf..f53fb6f9b88 100644
--- a/lib/emails/EventAttendeeMail.ts
+++ b/lib/emails/EventAttendeeMail.ts
@@ -134,7 +134,7 @@ export default class EventAttendeeMail extends EventMail {
replyTo: this.calEvent.organizer.email,
subject: `Confirmed: ${this.calEvent.type} with ${
this.calEvent.organizer.name
- } on ${this.getInviteeStart().format("dddd, LL")}`,
+ } on ${this.getInviteeStart().format("LT dddd, LL")}`,
html: this.getHtmlRepresentation(),
text: this.getPlainTextRepresentation(),
};
diff --git a/lib/emails/EventOrganizerMail.ts b/lib/emails/EventOrganizerMail.ts
index 184a062d9bf..e5ee36b7431 100644
--- a/lib/emails/EventOrganizerMail.ts
+++ b/lib/emails/EventOrganizerMail.ts
@@ -107,8 +107,8 @@ export default class EventOrganizerMail extends EventMail {
</tr>
<tr>
<td>When</td>
- <td>${this.getInviteeStart().format("dddd, LL")}<br>${this.getInviteeStart().format("h:mma")} (${
- this.calEvent.attendees[0].timeZone
+ <td>${this.getOrganizerStart().format("dddd, LL")}<br>${this.getOrganizerStart().format("h:mma")} (${
+ this.calEvent.organizer.timeZone
})</td>
</tr>
<tr>
@@ -191,10 +191,9 @@ export default class EventOrganizerMail extends EventMail {
}
protected getSubject(): string {
- const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
- return `New event: ${this.calEvent.attendees[0].name} - ${organizerStart.format("LT dddd, LL")} - ${
- this.calEvent.type
- }`;
+ return `New event: ${this.calEvent.attendees[0].name} - ${this.getOrganizerStart().format(
+ "LT dddd, LL"
+ )} - ${this.calEvent.type}`;
}
protected printNodeMailerError(error: string): void {
@@ -202,11 +201,11 @@ export default class EventOrganizerMail extends EventMail {
}
/**
- * Returns the inviteeStart value used at multiple points.
+ * Returns the organizerStart value used at multiple points.
*
* @private
*/
- protected getInviteeStart(): Dayjs {
- return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
+ protected getOrganizerStart(): Dayjs {
+ return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
}
}