feat: add option to provide cancellation reason for email (#1587)

* feat: add option to provide cancellation reason for email

* chore: move pos of getCancellationReason method in classes

* fix: only show cancellation reason if given
This commit is contained in:
Nikolay Rademacher authored and GitHub committed 2022-01-28 10:40:29 -07:00
1 parent 8d0861809c
commit 07b75dadbd
9 files changed
+85 -41

No files matched your search

@@ -48,6 +48,7 @@ ${this.getWhat()}
${this.getWhen()}
${this.getLocation()}
${this.getAdditionalNotes()}
${this.calEvent.cancellationReason && this.getCancellationReason()}
`.replace(/(<([^>]+)>)/gi, "");
}
@@ -95,6 +96,7 @@ ${this.getAdditionalNotes()}
${this.getWho()}
${this.getLocation()}
${this.getAdditionalNotes()}
${this.calEvent.cancellationReason && this.getCancellationReason()}
</div>
</td>
</tr>
@@ -126,4 +128,13 @@ ${this.getAdditionalNotes()}
</html>
`;
}
protected getCancellationReason(): string {
return `
<p style="height: 6px"></p>
<div style="line-height: 6px;">
<p style="color: #494949;">${this.calEvent.attendees[0].language.translate("cancellation_reason")}</p>
<p style="color: #494949; font-weight: 400; line-height: 24px;">${this.calEvent.cancellationReason}</p>
</div>`;
}
}
@@ -57,6 +57,7 @@ ${this.getWhat()}
${this.getWhen()}
${this.getLocation()}
${this.getAdditionalNotes()}
${this.calEvent.cancellationReason && this.getCancellationReason()}
`.replace(/(<([^>]+)>)/gi, "");
}
@@ -103,6 +104,7 @@ ${this.getAdditionalNotes()}
${this.getWho()}
${this.getLocation()}
${this.getAdditionalNotes()}
${this.calEvent.cancellationReason && this.getCancellationReason()}
</div>
</td>
</tr>
@@ -134,4 +136,13 @@ ${this.getAdditionalNotes()}
</html>
`;
}
protected getCancellationReason(): string {
return `
<p style="height: 6px"></p>
<div style="line-height: 6px;">
<p style="color: #494949;">${this.calEvent.organizer.language.translate("cancellation_reason")}</p>
<p style="color: #494949; font-weight: 400; line-height: 24px;">${this.calEvent.cancellationReason}</p>
</div>`;
}
}
@@ -52,6 +52,7 @@ export interface CalendarEvent {
videoCallData?: VideoCallData;
paymentInfo?: PaymentInfo | null;
destinationCalendar?: DestinationCalendar | null;
cancellationReason?: string | null;
}
export interface IntegrationCalendar extends Ensure<Partial<SelectedCalendar>, "externalId"> {