feat(emails): add re-send for all emails, failed tab, and resend indicators

- Add resend_attempts and last_resent_at to email_logs schema and migrations
- Add POST /api/emails/logs/:id/resend and emailService.resendFromLog
- Add resendLog API and EmailLog.resendAttempts/lastResentAt
- Add All/Failed sub-tabs, resend button for all emails, re-sent indicator in logs and detail modal

Made-with: Cursor
This commit is contained in:
Michilis
2026-03-12 19:13:24 +00:00
parent e09ff4ed60
commit 4da26e7ef1
6 changed files with 203 additions and 11 deletions

View File

@@ -492,7 +492,12 @@ export const emailsApi = {
},
getLog: (id: string) => fetchApi<{ log: EmailLog }>(`/api/emails/logs/${id}`),
resendLog: (id: string) =>
fetchApi<{ success: boolean; error?: string }>(`/api/emails/logs/${id}/resend`, {
method: 'POST',
}),
getStats: (eventId?: string) => {
const query = eventId ? `?eventId=${eventId}` : '';
return fetchApi<{ stats: EmailStats }>(`/api/emails/stats${query}`);
@@ -792,6 +797,8 @@ export interface EmailLog {
sentAt?: string;
sentBy?: string;
createdAt: string;
resendAttempts?: number;
lastResentAt?: string;
}
export interface EmailStats {