feat: OOO booking-forwarding (#12653)
* feat-profile-forwarding * fix for promises of handling * fix badge success color * clean up * fix suggested changes * Changed design on booking-forward pages and moar test * taking care of suggested changes, trpc errors and code cleaning * improve text * fix conflicting data-testid * fix unique data-testid * fix error css-global, email button styles, error conditional * rename files to match functionality, remove away ui * Add translations and migration * remove log * small fixes + improvements * fix styles to match new design * merge fixes * Fix styles dark mode * Solving merge conflicts from earlier * Fix/change test to match new elements * use trash icon button insted of dots (design issues) * only send email if toUserId is set * Fix date picker dark mode * merge with remote * removed status field from table and email its now for notify * small text improvement in email * check for team plan not paid plan * fixes and clean up due to removing status * fix old send request name to new behaviour * more naming improvements and text * remove status from handle-type * code clean up * fix type error --------- Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
24 files changed
+1249
-62
No files matched your search
@@ -24,6 +24,8 @@ import AttendeeScheduledEmail from "./templates/attendee-scheduled-email";
|
||||
import type { EmailVerifyCode } from "./templates/attendee-verify-email";
|
||||
import AttendeeVerifyEmail from "./templates/attendee-verify-email";
|
||||
import AttendeeWasRequestedToRescheduleEmail from "./templates/attendee-was-requested-to-reschedule-email";
|
||||
import BookingRedirectEmailNotification from "./templates/booking-redirect-notification";
|
||||
import type { IBookingRedirect } from "./templates/booking-redirect-notification";
|
||||
import BrokenIntegrationEmail from "./templates/broken-integration-email";
|
||||
import DisabledAppEmail from "./templates/disabled-app-email";
|
||||
import type { Feedback } from "./templates/feedback-email";
|
||||
@@ -437,3 +439,7 @@ export const sendMonthlyDigestEmails = async (eventData: MonthlyDigestEmailData)
|
||||
export const sendAdminOrganizationNotification = async (input: OrganizationNotification) => {
|
||||
await sendEmail(() => new AdminOrganizationNotification(input));
|
||||
};
|
||||
|
||||
export const sendBookingRedirectNotification = async (bookingRedirect: IBookingRedirect) => {
|
||||
await sendEmail(() => new BookingRedirectEmailNotification(bookingRedirect));
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { IBookingRedirect } from "../../templates/booking-redirect-notification";
|
||||
import { BaseEmailHtml } from "../components";
|
||||
|
||||
export const BookingRedirectEmailNotification = (
|
||||
props: IBookingRedirect & Partial<React.ComponentProps<typeof BaseEmailHtml>>
|
||||
) => {
|
||||
return (
|
||||
<BaseEmailHtml
|
||||
subject={props.language("booking_redirect_email_subject")}
|
||||
title={props.language("booking_redirect_email_title")}>
|
||||
<p
|
||||
style={{
|
||||
color: "black",
|
||||
fontSize: "16px",
|
||||
lineHeight: "24px",
|
||||
fontWeight: "400",
|
||||
}}>
|
||||
{props.language("booking_redirect_email_description", {
|
||||
toName: props.toName,
|
||||
})}
|
||||
{props.dates}
|
||||
<br />
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
marginTop: "16px",
|
||||
}}
|
||||
/>
|
||||
</p>
|
||||
</BaseEmailHtml>
|
||||
);
|
||||
};
|
||||
@@ -31,3 +31,4 @@ export { OrganisationAccountVerifyEmail } from "./OrganizationAccountVerifyEmail
|
||||
export { OrgAutoInviteEmail } from "./OrgAutoInviteEmail";
|
||||
export { MonthlyDigestEmail } from "./MonthlyDigestEmail";
|
||||
export { AdminOrganizationNotificationEmail } from "./AdminOrganizationNotificationEmail";
|
||||
export { BookingRedirectEmailNotification } from "./BookingRedirectEmailNotification";
|
||||
@@ -0,0 +1,36 @@
|
||||
import type { TFunction } from "next-i18next";
|
||||
|
||||
import { APP_NAME } from "@calcom/lib/constants";
|
||||
|
||||
import { renderEmail } from "..";
|
||||
import BaseEmail from "./_base-email";
|
||||
|
||||
export interface IBookingRedirect {
|
||||
language: TFunction;
|
||||
fromEmail: string;
|
||||
toEmail: string;
|
||||
toName: string;
|
||||
dates: string;
|
||||
}
|
||||
|
||||
export default class BookingRedirectNotification extends BaseEmail {
|
||||
bookingRedirect: IBookingRedirect;
|
||||
|
||||
constructor(bookingRedirect: IBookingRedirect) {
|
||||
super();
|
||||
this.name = "BOOKING_REDIRECT_NOTIFICATION";
|
||||
this.bookingRedirect = bookingRedirect;
|
||||
}
|
||||
|
||||
protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {
|
||||
return {
|
||||
to: `${this.bookingRedirect.toEmail} <${this.bookingRedirect.toName}>`,
|
||||
from: `${APP_NAME} <${this.getMailerOptions().from}>`,
|
||||
subject: this.bookingRedirect.language("booking_redirect_email_subject"),
|
||||
html: await renderEmail("BookingRedirectEmailNotification", {
|
||||
...this.bookingRedirect,
|
||||
}),
|
||||
text: "",
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user