Skip to content

Send Email to Owner on Form Submission#5261

Merged
hariombalhara merged 7 commits intomainfrom
feat/email-on-form-response
Nov 3, 2022
Merged

Send Email to Owner on Form Submission#5261
hariombalhara merged 7 commits intomainfrom
feat/email-on-form-response

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Oct 28, 2022

What does this PR do?

Closes #5111
Loom Video: https://www.loom.com/share/52c9fc27b5154cb1a02c154f320bec61

Environment: Production

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Create a new Routing Form and the email should go on form submission automatically
  • Disable the email and it should now stop going.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 28, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Nov 3, 2022 at 2:36PM (UTC)

Copy link
Copy Markdown
Contributor

@pumfleet pumfleet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for building this!

Copy link
Copy Markdown
Member Author

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review done

}}>
<p style={{ fontWeight: 400, lineHeight: "24px" }}>
<a href={`${WEBAPP_URL}/apps/routing-forms/form-edit/${form.id}`} style={{ color: "#3e3e3e" }}>
<>Manage this form</>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PeerRich What language should this be in? Should this be the language configured by the person who created the form? or english would work?


const fieldResponsesByName: Record<string, typeof response[keyof typeof response]["value"]> = {};

for (const [fieldId, fieldResponse] of Object.entries(response)) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this logic to onFormSubmit

}

const missingFields = fields
const serializableFormWithFields = {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a type that has fields set unlike serializableForm which has fields optional.

prisma,
user
user,
ssrInit
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provides the method that would allow app pages to do translations server side.

export { OrganizerScheduledEmail } from "./OrganizerScheduledEmail";
export { TeamInviteEmail } from "./TeamInviteEmail";
export { BrokenIntegrationEmail } from "./BrokenIntegrationEmail";
export * from "@calcom/app-store/ee/routing-forms/emails/components";
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import all email components here so that renderEmail method supports routing-forms email components as welll

@hariombalhara hariombalhara merged commit 6a002b9 into main Nov 3, 2022
@hariombalhara hariombalhara deleted the feat/email-on-form-response branch November 3, 2022 14:40
haffla pushed a commit to tourlane/cal.com that referenced this pull request Nov 22, 2022
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge ♻️ autoupdate tells kodiak to keep this branch up-to-date core area: core, team members only ❗️ migrations contains migration files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-197] sent email of routing form results to owner

4 participants