fix: organizer/attendee timezones in emails (#543)
This commit is contained in:
parent
8e9703545a
commit
1ab9d1797a
2 changed files with 9 additions and 10 deletions
|
@ -134,7 +134,7 @@ export default class EventAttendeeMail extends EventMail {
|
||||||
replyTo: this.calEvent.organizer.email,
|
replyTo: this.calEvent.organizer.email,
|
||||||
subject: `Confirmed: ${this.calEvent.type} with ${
|
subject: `Confirmed: ${this.calEvent.type} with ${
|
||||||
this.calEvent.organizer.name
|
this.calEvent.organizer.name
|
||||||
} on ${this.getInviteeStart().format("dddd, LL")}`,
|
} on ${this.getInviteeStart().format("LT dddd, LL")}`,
|
||||||
html: this.getHtmlRepresentation(),
|
html: this.getHtmlRepresentation(),
|
||||||
text: this.getPlainTextRepresentation(),
|
text: this.getPlainTextRepresentation(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -107,8 +107,8 @@ export default class EventOrganizerMail extends EventMail {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>When</td>
|
<td>When</td>
|
||||||
<td>${this.getInviteeStart().format("dddd, LL")}<br>${this.getInviteeStart().format("h:mma")} (${
|
<td>${this.getOrganizerStart().format("dddd, LL")}<br>${this.getOrganizerStart().format("h:mma")} (${
|
||||||
this.calEvent.attendees[0].timeZone
|
this.calEvent.organizer.timeZone
|
||||||
})</td>
|
})</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -191,10 +191,9 @@ export default class EventOrganizerMail extends EventMail {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getSubject(): string {
|
protected getSubject(): string {
|
||||||
const organizerStart: Dayjs = <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
return `New event: ${this.calEvent.attendees[0].name} - ${this.getOrganizerStart().format(
|
||||||
return `New event: ${this.calEvent.attendees[0].name} - ${organizerStart.format("LT dddd, LL")} - ${
|
"LT dddd, LL"
|
||||||
this.calEvent.type
|
)} - ${this.calEvent.type}`;
|
||||||
}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected printNodeMailerError(error: string): void {
|
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
|
* @private
|
||||||
*/
|
*/
|
||||||
protected getInviteeStart(): Dayjs {
|
protected getOrganizerStart(): Dayjs {
|
||||||
return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.attendees[0].timeZone);
|
return <Dayjs>dayjs(this.calEvent.startTime).tz(this.calEvent.organizer.timeZone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue