Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
chore: reverts 9816333
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsfletch committed Jan 18, 2023
1 parent 65dedc2 commit 06fb4bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
6 changes: 2 additions & 4 deletions src/collections/FormSubmissions/hooks/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ({
Expand Down
26 changes: 3 additions & 23 deletions src/collections/Forms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf
required: true,
admin: {
width: '100%',
placeholder: 'Email Sender <[email protected]>'
placeholder: '"Email Sender" <[email protected]>'
},
},
{
Expand Down Expand Up @@ -186,36 +186,16 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf
label: 'Reply To',
admin: {
width: '50%',
placeholder: '"Reply To" <[email protected]>',
},
},
{
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" <[email protected]>',
},
},
],
Expand Down
2 changes: 0 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 06fb4bd

Please sign in to comment.