Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2b7128f
Update email sending functionality and improve styling in Announcemen…
csk731 Sep 28, 2025
56d1b73
Remove NewsletterTemplateEditor and OneCommunityNewsletterTemplate co…
csk731 Sep 28, 2025
85e0fd9
Refactor NewsletterTemplateEditor and OneCommunityNewsletterTemplate …
csk731 Sep 28, 2025
fdb6c07
Enhance email functionality in NewsletterTemplateEditor by adding sub…
csk731 Sep 28, 2025
1f77a61
Refactor email sending actions to include requestor information for p…
csk731 Sep 28, 2025
fc85646
Add Email Template Management route and enhance Announcements compone…
csk731 Oct 12, 2025
49eab3c
Refactor Email Template Management for improved dark mode support and…
csk731 Oct 15, 2025
7643611
Refactor Email Template Management and enhance Announcements component
csk731 Oct 21, 2025
42d5e4b
Enhance email sending functionality by integrating axios for API call…
csk731 Oct 23, 2025
f28dbfc
Add Email Batch Dashboard and enhance routing for announcements
csk731 Oct 24, 2025
44c4e61
Enhance Email Batch Dashboard with dark mode support, countdown timer…
csk731 Oct 25, 2025
d4491aa
Refactor Email Management styles and enhance IntegratedEmailSender co…
csk731 Oct 26, 2025
630fdc4
Refactor Email Management components to improve error handling, add m…
csk731 Oct 26, 2025
05ebd5d
Add email audit functionality to Email Batch Dashboard
csk731 Oct 29, 2025
bd4d425
Enhance Email Management functionality and routing
csk731 Oct 30, 2025
5e794cb
Refactor IntegratedEmailSender to improve template data handling
csk731 Oct 30, 2025
944a6e2
Refactor Email Management components and remove deprecated functionality
csk731 Nov 11, 2025
4807137
Remove deprecated audit trail functionality and associated styles fro…
csk731 Nov 11, 2025
f8cf243
Update package dependencies and add Webpack support
csk731 Nov 11, 2025
cbe5151
feat: Enhanced Email Management UI/UX with responsive design and filters
Dec 3, 2025
34a32b5
FrontEnd_EmailManagementSystem
Dec 4, 2025
763f504
Fix axios defaults undefined error during tests
apoorvajainrp21 Dec 4, 2025
10af8b7
Update EmailOutbox after merge prep
apoorvajainrp21 Dec 4, 2025
fc9af16
Fix: Completed all UI/UX issues for email management system
Dec 14, 2025
ca846e8
Fix: Resolve email management issues - VIDEO type, draft clearing, of…
Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
17,434 changes: 17,434 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"date-fns-tz": "^2.0.1",
"dayjs": "^1.11.13",
"diff": "^5.0.0",
"dompurify": "^3.2.5",
"dompurify": "^3.3.0",
"elliptic": "^6.6.1",
"font-awesome": "^4.7.0",
"fs-extra": "^11.3.0",
Expand Down Expand Up @@ -114,7 +114,8 @@
"stream-browserify": "^3.0.0",
"tinymce": "^7.2.0",
"util": "^0.12.5",
"uuid": "^9.0.1"
"uuid": "^9.0.1",
"webpack": "^5.102.1"
},
"resolutions": {
"react": "18.3.1",
Expand Down
85 changes: 85 additions & 0 deletions src/actions/emailOutboxActions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import httpService from '../services/httpService';
import { toast } from 'react-toastify';

// Action Types
// Note: EMAIL = parent Email record, EMAIL_BATCH = child EmailBatch item
export const EMAIL_OUTBOX_ACTIONS = {
FETCH_EMAILS_START: 'FETCH_EMAILS_START',
FETCH_EMAILS_SUCCESS: 'FETCH_EMAILS_SUCCESS',
FETCH_EMAILS_ERROR: 'FETCH_EMAILS_ERROR',
};

// Fetch emails (parent Email records) - Outbox list
// Backend returns: { success: true, data: emails[] }
export const fetchEmails = () => async (dispatch) => {
try {
dispatch({ type: EMAIL_OUTBOX_ACTIONS.FETCH_EMAILS_START });

const response = await httpService.get('/api/email-outbox');

if (response.data.success) {
// Backend returns data as array directly
const emails = Array.isArray(response.data.data) ? response.data.data : [];

dispatch({
type: EMAIL_OUTBOX_ACTIONS.FETCH_EMAILS_SUCCESS,
payload: emails,
});

return emails;
} else {
throw new Error(response.data.message || 'Failed to fetch emails');
}
} catch (error) {
const errorMessage = error.response?.data?.message || error.message || 'Failed to fetch emails';
dispatch({
type: EMAIL_OUTBOX_ACTIONS.FETCH_EMAILS_ERROR,
payload: errorMessage,
});
toast.error(errorMessage);
throw error;
}
};

// Resend email with selected recipient option
// Backend endpoint: POST /api/resend-email
// Backend returns: { success: true, message: '...', data: { emailId: '...', recipientCount: ... } }
export const resendEmail = (emailId, recipientOption, specificRecipients = []) => async (dispatch, getState) => {
try {
// Get current user for requestor (required by backend)
const state = getState();
const currentUser = state.auth?.user;

if (!currentUser || !currentUser.userid) {
throw new Error('User authentication required to resend emails');
}

const requestor = {
requestorId: currentUser.userid,
email: currentUser.email,
role: currentUser.role,
};

const response = await httpService.post('/api/resend-email', {
emailId,
recipientOption,
specificRecipients: Array.isArray(specificRecipients) ? specificRecipients : [],
requestor,
});

if (response.data.success) {
const message = response.data.message || 'Email created for resend successfully. Processing started.';
toast.success(message);
// Refresh the emails list
await dispatch(fetchEmails());
return response.data.data;
} else {
throw new Error(response.data.message || 'Failed to resend email');
}
} catch (error) {
const errorMessage = error.response?.data?.message || error.message || 'Failed to resend email';
toast.error(errorMessage);
throw error;
}
};

Loading