-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into improve-multilingua…
…lism # Conflicts: # apps/web/public/static/locales/en/common.json
- Loading branch information
Showing
22 changed files
with
390 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/app-store/ee/routing-forms/emails/components/ResponseEmail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { BaseEmailHtml, Info } from "@calcom/emails/src/components"; | ||
import { WEBAPP_URL } from "@calcom/lib/constants"; | ||
|
||
import { Response } from "../../types/types"; | ||
import { App_RoutingForms_Form } from ".prisma/client"; | ||
|
||
export const ResponseEmail = ({ | ||
form, | ||
response, | ||
...props | ||
}: { | ||
form: Pick<App_RoutingForms_Form, "id" | "name">; | ||
response: Response; | ||
subject: string; | ||
} & Partial<React.ComponentProps<typeof BaseEmailHtml>>) => { | ||
return ( | ||
<BaseEmailHtml | ||
callToAction={ | ||
<div | ||
style={{ | ||
fontFamily: "Roboto, Helvetica, sans-serif", | ||
fontSize: "16px", | ||
fontWeight: 500, | ||
lineHeight: "0px", | ||
textAlign: "left", | ||
color: "#3e3e3e", | ||
}}> | ||
<p style={{ fontWeight: 400, lineHeight: "24px" }}> | ||
<a href={`${WEBAPP_URL}/apps/routing-forms/form-edit/${form.id}`} style={{ color: "#3e3e3e" }}> | ||
<>Manage this form</> | ||
</a> | ||
</p> | ||
</div> | ||
} | ||
title={form.name} | ||
subtitle="New Response Received" | ||
{...props}> | ||
{Object.entries(response).map(([fieldId, fieldResponse]) => { | ||
return ( | ||
<Info | ||
withSpacer | ||
key={fieldId} | ||
label={fieldResponse.label} | ||
description={ | ||
fieldResponse.value instanceof Array ? fieldResponse.value.join(",") : fieldResponse.value | ||
} | ||
/> | ||
); | ||
})} | ||
</BaseEmailHtml> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/app-store/ee/routing-forms/emails/components/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { ResponseEmail } from "./ResponseEmail"; |
33 changes: 33 additions & 0 deletions
33
packages/app-store/ee/routing-forms/emails/templates/response-email.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { renderEmail } from "@calcom/emails"; | ||
import BaseEmail from "@calcom/emails/templates/_base-email"; | ||
|
||
import { Response } from "../../types/types"; | ||
import { App_RoutingForms_Form } from ".prisma/client"; | ||
|
||
type Form = Pick<App_RoutingForms_Form, "id" | "name">; | ||
export default class ResponseEmail extends BaseEmail { | ||
response: Response; | ||
toAddresses: string[]; | ||
form: Form; | ||
constructor({ toAddresses, response, form }: { form: Form; toAddresses: string[]; response: Response }) { | ||
super(); | ||
this.form = form; | ||
this.response = response; | ||
this.toAddresses = toAddresses; | ||
} | ||
|
||
protected getNodeMailerPayload(): Record<string, unknown> { | ||
const toAddresses = this.toAddresses; | ||
const subject = `${this.form.name} has a new response`; | ||
return { | ||
from: `Cal.com <${this.getMailerOptions().from}>`, | ||
to: toAddresses.join(","), | ||
subject, | ||
html: renderEmail("ResponseEmail", { | ||
form: this.form, | ||
response: this.response, | ||
subject, | ||
}), | ||
}; | ||
} | ||
} |
Oops, something went wrong.