From 515efe102ac9a3d6fe30ef916d028da9bc73a027 Mon Sep 17 00:00:00 2001 From: Alexander Petkov Date: Wed, 19 Jun 2024 13:36:24 +0300 Subject: [PATCH] feat: Add email subject to form Will be used if subject is set dynamically to sendgrid --- public/locales/bg/marketing.json | 3 ++- public/locales/en/marketing.json | 3 ++- .../admin/marketing/EmailConsent/SendEmailConsentForm.tsx | 6 ++++++ src/gql/marketing.ts | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/locales/bg/marketing.json b/public/locales/bg/marketing.json index a1d91ae86..54cfa08cd 100644 --- a/public/locales/bg/marketing.json +++ b/public/locales/bg/marketing.json @@ -4,7 +4,8 @@ "sendConsentEmail": "Изпращане на емайл за съгласие", "common": { "templateId": "Идентификатор на Sendgrid шаблон", - "listId": "Идентифицатор на Sendgrid списък с контакти" + "listId": "Идентифицатор на Sendgrid списък с контакти", + "subject": "Тема на емайл" } } } diff --git a/public/locales/en/marketing.json b/public/locales/en/marketing.json index 35a56c394..43bc2206b 100644 --- a/public/locales/en/marketing.json +++ b/public/locales/en/marketing.json @@ -4,7 +4,8 @@ "sendConsentEmail": "Send newsletter consent email", "common": { "templateId": "ID of Sendgrid template", - "listId": "ID of Sendgrid contact list" + "listId": "ID of Sendgrid contact list", + "subject": "Email subject" } } } diff --git a/src/components/admin/marketing/EmailConsent/SendEmailConsentForm.tsx b/src/components/admin/marketing/EmailConsent/SendEmailConsentForm.tsx index 83c2c4ff1..0e8b5fa53 100644 --- a/src/components/admin/marketing/EmailConsent/SendEmailConsentForm.tsx +++ b/src/components/admin/marketing/EmailConsent/SendEmailConsentForm.tsx @@ -21,12 +21,14 @@ export default function SendConsentEmailForm() { const initialValues: SendNewsLetterConsent = { templateId: '', listId: '', + subject: '', dateThreshold: new Date().toISOString(), } const validationSchema: yup.SchemaOf = yup.object().defined().shape({ templateId: yup.string().required(), listId: yup.string().required(), + subject: yup.string().required(), dateThreshold: yup.string().optional(), }) @@ -60,6 +62,7 @@ export default function SendConsentEmailForm() { const data: SendNewsLetterConsent = { templateId: values.templateId, listId: values.listId, + subject: values.subject, dateThreshold: values.dateThreshold, } await mutation.mutateAsync(data) @@ -86,6 +89,9 @@ export default function SendConsentEmailForm() { + + +