From 78f473198277a0f7ac6fea873f10441dcf8b3944 Mon Sep 17 00:00:00 2001 From: Chuck Carpenter Date: Fri, 12 Apr 2024 16:36:26 -0700 Subject: [PATCH] =?UTF-8?q?App:=20=E2=9C=A8=20Add=20description=20field=20?= =?UTF-8?q?to=20demo=20request=20form=20(#2716)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/src/graphql/emails.sdl.ts | 1 + app/api/src/mail/DemoRequest/DemoRequest.tsx | 5 +++- app/api/src/services/emails/emails.ts | 4 +-- app/api/types/graphql.d.ts | 1 + .../src/components/DemoDialog/DemoDialog.tsx | 28 ++++++++++++++----- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/app/api/src/graphql/emails.sdl.ts b/app/api/src/graphql/emails.sdl.ts index fc689a00a..29d75f1a9 100644 --- a/app/api/src/graphql/emails.sdl.ts +++ b/app/api/src/graphql/emails.sdl.ts @@ -9,6 +9,7 @@ export const schema = gql` name: String subject: String title: String + description: String } type EmailResponse { diff --git a/app/api/src/mail/DemoRequest/DemoRequest.tsx b/app/api/src/mail/DemoRequest/DemoRequest.tsx index bc000f7b3..2c5b41a58 100644 --- a/app/api/src/mail/DemoRequest/DemoRequest.tsx +++ b/app/api/src/mail/DemoRequest/DemoRequest.tsx @@ -15,7 +15,7 @@ import { } from '@react-email/components'; import { Tailwind } from '@react-email/tailwind'; -export function DemoRequest({ from, name, title, when }) { +export function DemoRequest({ description, from, name, title, when }) { return ( @@ -55,6 +55,9 @@ export function DemoRequest({ from, name, title, when }) { {`new demo request on ${when}`} + + {`Customer needs help with: ${description}`} + diff --git a/app/api/src/services/emails/emails.ts b/app/api/src/services/emails/emails.ts index 5a8638607..11123b6f3 100644 --- a/app/api/src/services/emails/emails.ts +++ b/app/api/src/services/emails/emails.ts @@ -16,14 +16,14 @@ export const sendDemoRequest: QueryResolvers['sendDemoRequest'] = async ({ logger.debug(input, 'creating demo email ...'); try { - const { from, name, subject, title } = input; + const { description, from, name, subject, title } = input; const to = defaultEmail; const when = new Date().toLocaleString(); logger.debug({ ...input, to, when }, 'sending email ....'); const data: MailResult = await mailer.send( - DemoRequest({ from, name, title, when }), + DemoRequest({ description, from, name, title, when }), { from, to, diff --git a/app/api/types/graphql.d.ts b/app/api/types/graphql.d.ts index e86c5ff69..9e57419f2 100644 --- a/app/api/types/graphql.d.ts +++ b/app/api/types/graphql.d.ts @@ -131,6 +131,7 @@ export type CreateUserInput = { }; export type DemoEmailInput = { + description?: InputMaybe; from: Scalars['String']; name?: InputMaybe; subject?: InputMaybe; diff --git a/app/web/src/components/DemoDialog/DemoDialog.tsx b/app/web/src/components/DemoDialog/DemoDialog.tsx index 9465b3781..ca1b3a510 100644 --- a/app/web/src/components/DemoDialog/DemoDialog.tsx +++ b/app/web/src/components/DemoDialog/DemoDialog.tsx @@ -2,6 +2,7 @@ import { useLazyQuery } from '@apollo/client'; import { Form, + TextAreaField, TextField, EmailField, FieldError, @@ -65,10 +66,10 @@ const DemoDialog = () => { Name { Email { Job Title { name="title" /> +
+ + + +
- + Submit Info