selected and email submission was successful
                if (emailResult.success && preferences.length > 0) {
                    const surveyData = new FormData();
                    surveyData.append('email', email);
                    preferences.forEach(pref => surveyData.append('preferences', pref));
                    
                    try {
                        await fetch('/submit_survey', {
                            method: 'POST',
                            body: surveyData
       