Skip to content

Commit d3192e1

Browse files
Merge pull request #3524 from OneCommunityGlobal/revert-3148-Shraddha-fix-send-out-emails-from-send-emails-tab
Revert "Shraddha Shahari - Fix the inability to send out emails from send emails tab"
2 parents 5e485ad + 1316551 commit d3192e1

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/components/Announcements/index.jsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function Announcements({ title, email }) {
1414
const [emailContent, setEmailContent] = useState('');
1515
const [headerContent, setHeaderContent] = useState('');
1616
const [showEditor, setShowEditor] = useState(true); // State to control rendering of the editor
17-
const [isFileUploaded, setIsFileUploaded] = useState(false);
17+
const tinymce = useRef(null);
1818

1919
useEffect(() => {
2020
// Toggle the showEditor state to force re-render when dark mode changes
@@ -123,8 +123,6 @@ function Announcements({ title, email }) {
123123

124124
const addImageToEmailContent = e => {
125125
const imageFile = document.querySelector('input[type="file"]').files[0];
126-
setIsFileUploaded(true);
127-
128126
convertImageToBase64(imageFile, base64Image => {
129127
const imageTag = `<img src="${base64Image}" alt="Header Image" style="width: 100%; max-width: 100%; height: auto;">`;
130128
setHeaderContent(prevContent => `${imageTag}${prevContent}`);
@@ -151,13 +149,7 @@ function Announcements({ title, email }) {
151149
return;
152150
}
153151

154-
if (!isFileUploaded) {
155-
toast.error('Error: Please upload a file.');
156-
return;
157-
}
158-
159-
const invalidEmails = emailList.filter(email => !validateEmail(email.trim()));
160-
152+
const invalidEmails = emailList.filter(e => !validateEmail(e.trim()));
161153

162154
if (invalidEmails.length > 0) {
163155
toast.error(`Error: Invalid email addresses: ${invalidEmails.join(', ')}`);

0 commit comments

Comments
 (0)