diff --git a/frontend/src/components/EventForm.tsx b/frontend/src/components/EventForm.tsx index cfbae36..926d04f 100644 --- a/frontend/src/components/EventForm.tsx +++ b/frontend/src/components/EventForm.tsx @@ -50,6 +50,7 @@ interface FormData { email_notifications_enabled: boolean; email_recipients: string; thank_you_message: string; // Added thank you message field + event_conclusion_email_enabled: boolean; // Added state for event conclusion email toggle } const EventForm: React.FC = () => { @@ -65,6 +66,7 @@ const EventForm: React.FC = () => { email_notifications_enabled: false, email_recipients: '', thank_you_message: '', // Added thank you message state + event_conclusion_email_enabled: false, // Initialize new state }); const [wallpaper, setWallpaper] = useState(null); const [currentItem, setCurrentItem] = useState(''); @@ -116,7 +118,7 @@ const EventForm: React.FC = () => { setError(null); try { const submitData = new FormData(); - + // Append all form fields Object.entries(formData).forEach(([key, value]) => { if (key === 'needed_items') { @@ -128,6 +130,9 @@ const EventForm: React.FC = () => { // Append thank you message submitData.append('thank_you_message', formData.thank_you_message); + // Append event conclusion email enabled state + submitData.append('event_conclusion_email_enabled', String(formData.event_conclusion_email_enabled)); + // Append wallpaper if selected if (wallpaper) { @@ -148,11 +153,11 @@ const EventForm: React.FC = () => { return ( - { variant="outlined" placeholder="email1@example.com, email2@example.com" helperText="Enter email addresses separated by commas" + sx={{ mt: 2 }} // Added margin top for spacing /> )} - { + setFormData((prev) => ({ + ...prev, + event_conclusion_email_enabled: e.target.checked, + })); + }} + sx={{ + color: 'rgba(255, 255, 255, 0.7)', + '&.Mui-checked': { + color: '#90caf9', + }, + }} + /> + } + label="Enable Event Conclusion Email" + sx={{ + color: 'rgba(255, 255, 255, 0.9)', + mt: 2, // Added margin top for spacing + }} /> + + {formData.event_conclusion_email_enabled && ( + + )}