From 06fb4bd901157223a06bd197a3dcc6909d5d14a2 Mon Sep 17 00:00:00 2001 From: Jacob Fletcher Date: Wed, 18 Jan 2023 08:00:09 -0500 Subject: [PATCH] chore: reverts 9816333 --- .../FormSubmissions/hooks/sendEmail.ts | 6 ++--- src/collections/Forms/index.ts | 26 +++---------------- src/types.ts | 2 -- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/collections/FormSubmissions/hooks/sendEmail.ts b/src/collections/FormSubmissions/hooks/sendEmail.ts index 97edb1d..f91bd34 100644 --- a/src/collections/FormSubmissions/hooks/sendEmail.ts +++ b/src/collections/FormSubmissions/hooks/sendEmail.ts @@ -48,16 +48,14 @@ const sendEmail = async (beforeChangeData: any, formConfig: PluginConfig) => { cc: emailCC, bcc: emailBCC, emailFrom, - emailFromName, replyTo: emailReplyTo, - replyToName, } = email; const to = replaceDoubleCurlys(emailTo, submissionData); const cc = emailCC ? replaceDoubleCurlys(emailCC, submissionData) : ''; const bcc = emailBCC ? replaceDoubleCurlys(emailBCC, submissionData) : ''; - const from = replaceDoubleCurlys(emailFromName ? `"${emailFromName}" ` + emailFrom : emailFrom, submissionData); - const replyTo = replaceDoubleCurlys(replyToName ? `"${replyToName}" ` + emailReplyTo : emailReplyTo || emailFrom, submissionData); + const from = replaceDoubleCurlys(emailFrom, submissionData); + const replyTo = replaceDoubleCurlys(emailReplyTo || emailFrom, submissionData); if (to && from) { return ({ diff --git a/src/collections/Forms/index.ts b/src/collections/Forms/index.ts index 471520e..4b93775 100644 --- a/src/collections/Forms/index.ts +++ b/src/collections/Forms/index.ts @@ -156,7 +156,7 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf required: true, admin: { width: '100%', - placeholder: 'Email Sender ' + placeholder: '"Email Sender" ' }, }, { @@ -186,36 +186,16 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf label: 'Reply To', admin: { width: '50%', + placeholder: '"Reply To" ', }, }, - { - type: 'text', - name: 'replyToName', - label: 'Reply To Name', - admin: { - width: '50%', - }, - }, - ], - }, - { - type: 'row', - fields: [ { type: 'text', name: 'emailFrom', label: 'Email From', admin: { width: '50%', - placeholder: 'Email Recipient <{{email}}>', - }, - }, - { - type: 'text', - name: 'emailFromName', - label: 'Email From Name', - admin: { - width: '50%', + placeholder: '"Email From" ', }, }, ], diff --git a/src/types.ts b/src/types.ts index 2755e38..14d903b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -156,11 +156,9 @@ export type FormFieldBlock = TextField | TextAreaField | SelectField | EmailFiel export type Email = { emailTo: string emailFrom: string - emailFromName?: string cc?: string bcc?: string replyTo?: string - replyToName?: string subject: string message?: any // TODO: configure rich text type }