diff --git a/Surge365.MassEmailReact.Web/src/components/modals/MailingEdit.tsx b/Surge365.MassEmailReact.Web/src/components/modals/MailingEdit.tsx index 3e5517a..824f334 100644 --- a/Surge365.MassEmailReact.Web/src/components/modals/MailingEdit.tsx +++ b/Surge365.MassEmailReact.Web/src/components/modals/MailingEdit.tsx @@ -339,6 +339,8 @@ const MailingEdit = ({ open, mailing, onClose, onSave }: MailingEditProps) => { const handleTargetSampleModalOpen = () => { setTargetSampleModalOpen(!TargetSampleModalOpen); }; + const filteredTargets = setupData.targets.filter(t => t.isActive); + const filteredTemplates = setupData.templates.filter(t => t.isActive); return ( {/* Wrap with LocalizationProvider */} { onClose(reason); }} maxWidth="sm" fullWidth disableEscapeKeyDown > @@ -368,9 +370,9 @@ const MailingEdit = ({ open, mailing, onClose, onSave }: MailingEditProps) => { render={({ field }) => ( option.name} - value={setupData.templates.find(t => t.id === field.value) || null} + value={filteredTemplates.find(t => t.id === field.value) || null} onChange={(_, newValue) => { field.onChange(newValue ? newValue.id : null); trigger("templateId"); @@ -409,9 +411,9 @@ const MailingEdit = ({ open, mailing, onClose, onSave }: MailingEditProps) => { render={({ field }) => ( option.name} - value={setupData.targets.find(t => t.id === field.value) || null} + value={filteredTargets.find(t => t.id === field.value) || null} onChange={(_, newValue) => { field.onChange(newValue ? newValue.id : null); trigger("targetId"); diff --git a/Surge365.MassEmailReact.Web/src/components/modals/TemplateEdit.tsx b/Surge365.MassEmailReact.Web/src/components/modals/TemplateEdit.tsx index ad2bf57..30ce2f2 100644 --- a/Surge365.MassEmailReact.Web/src/components/modals/TemplateEdit.tsx +++ b/Surge365.MassEmailReact.Web/src/components/modals/TemplateEdit.tsx @@ -141,6 +141,7 @@ const TemplateEdit = ({ open, template, onClose, onSave }: TemplateEditProps) => ); + const filteredEmailDomains = setupData.emailDomains.filter((domain) => domain.isActive); return ( control={control} render={({ field }) => ( option.name} - value={setupData.emailDomains.find((d) => d.id === field.value) || null} + value={filteredEmailDomains.find((d) => d.id === field.value) || null} onChange={(_, newValue) => field.onChange(newValue ? newValue.id : null)} renderInput={(params) => (