hotfix: location on approval email (#1186)

* hotfix: location on confirmation email

* fix: build checks
This commit is contained in:
Mihai C 2021-11-18 13:13:38 +02:00 committed by GitHub
parent d6dd13a9d8
commit dfb1b5602d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 31 deletions

View file

@ -75,10 +75,7 @@ export default class EventAttendeeMail extends EventMail {
</small>
</td>
</tr>
<tr>
<td>${this.calEvent.language("where")}</td>
<td>${this.getLocation()}</td>
</tr>
${this.getLocation()}
<tr>
<td>${this.calEvent.language("notes")}</td>
<td>${this.calEvent.description}</td>
@ -107,7 +104,13 @@ export default class EventAttendeeMail extends EventMail {
*/
protected getLocation(): string {
if (this.calEvent.additionInformation?.hangoutLink) {
return `<a href="${this.calEvent.additionInformation?.hangoutLink}">${this.calEvent.additionInformation?.hangoutLink}</a><br />`;
return `<tr>
<td>${this.calEvent.language("where")}</td>
<td><a href="${this.calEvent.additionInformation?.hangoutLink}">${
this.calEvent.additionInformation?.hangoutLink
}</a><br /></td>
</tr>
`;
}
if (
@ -117,16 +120,30 @@ export default class EventAttendeeMail extends EventMail {
const locations = this.calEvent.additionInformation?.entryPoints
.map((entryPoint) => {
return `
${this.calEvent.language("join_by_entrypoint", { entryPoint: entryPoint.entryPointType })}: <br />
<a href="${entryPoint.uri}">${entryPoint.label}</a> <br />
`;
${this.calEvent.language("join_by_entrypoint", { entryPoint: entryPoint.entryPointType })}: <br />
<a href="${entryPoint.uri}">${entryPoint.label}</a> <br />
`;
})
.join("<br />");
return `${locations}`;
return `<tr>
<td>${this.calEvent.language("where")}</td>
<td>${locations}</td>
</tr>
`;
}
return this.calEvent.location ? `${this.calEvent.location}<br /><br />` : "";
if (!this.calEvent.location) {
return ``;
}
if (this.calEvent.location === "integrations:zoom" || this.calEvent.location === "integrations:daily") {
return ``;
}
return `<tr><td>${this.calEvent.language("where")}</td><td>${
this.calEvent.location
}<br /><br /></td></tr>`;
}
protected getAdditionalBody(): string {

View file

@ -3,7 +3,7 @@ import localizedFormat from "dayjs/plugin/localizedFormat";
import timezone from "dayjs/plugin/timezone";
import toArray from "dayjs/plugin/toArray";
import utc from "dayjs/plugin/utc";
import { createEvent } from "ics";
import { createEvent, DateArray } from "ics";
import { Person } from "@lib/calendarClient";
@ -26,7 +26,7 @@ export default class EventOrganizerMail extends EventMail {
.utc()
.toArray()
.slice(0, 6)
.map((v, i) => (i === 1 ? v + 1 : v)),
.map((v, i) => (i === 1 ? v + 1 : v)) as DateArray,
startInputType: "utc",
productId: "calendso/ics",
title: this.calEvent.language("organizer_ics_event_title", {
@ -125,10 +125,7 @@ export default class EventOrganizerMail extends EventMail {
this.calEvent.attendees[0].email
}">${this.calEvent.attendees[0].email}</a></small></td>
</tr>
<tr>
<td>${this.calEvent.language("where")}</td>
<td>${this.getLocation()}</td>
</tr>
${this.getLocation()}
<tr>
<td>${this.calEvent.language("notes")}</td>
<td>${this.calEvent.description}</td>
@ -157,7 +154,13 @@ export default class EventOrganizerMail extends EventMail {
*/
protected getLocation(): string {
if (this.calEvent.additionInformation?.hangoutLink) {
return `<a href="${this.calEvent.additionInformation?.hangoutLink}">${this.calEvent.additionInformation?.hangoutLink}</a><br />`;
return `<tr>
<td>${this.calEvent.language("where")}</td>
<td><a href="${this.calEvent.additionInformation?.hangoutLink}">${
this.calEvent.additionInformation?.hangoutLink
}</a><br /></td>
</tr>
`;
}
if (
@ -173,10 +176,24 @@ export default class EventOrganizerMail extends EventMail {
})
.join("<br />");
return `${locations}`;
return `<tr>
<td>${this.calEvent.language("where")}</td>
<td>${locations}</td>
</tr>
`;
}
return this.calEvent.location ? `${this.calEvent.location}<br /><br />` : "";
if (!this.calEvent.location) {
return ``;
}
if (this.calEvent.location === "integrations:zoom" || this.calEvent.location === "integrations:daily") {
return ``;
}
return `<tr><td>${this.calEvent.language("where")}</td><td>${
this.calEvent.location
}<br /><br /></td></tr>`;
}
protected getAdditionalBody(): string {

View file

@ -399,9 +399,9 @@ export default class EventManager {
// future, it might happen that we consider making passwords for Zoom meetings optional.
// Then, this part below (where the password existence is checked) needs to be adapted.
isComplete =
reference.meetingId != undefined &&
reference.meetingPassword != undefined &&
reference.meetingUrl != undefined;
reference.meetingId !== undefined &&
reference.meetingPassword !== undefined &&
reference.meetingUrl !== undefined;
break;
default:
isComplete = true;

View file

@ -170,15 +170,6 @@ const updateMeeting = async (
})
: undefined;
if (!updatedMeeting) {
return {
type: credential.type,
success,
uid,
originalEvent: calEvent,
};
}
try {
const organizerMail = new EventOrganizerRescheduledMail(calEvent);
await organizerMail.sendEmail();