Description
In mail.controller.js fetches the last 50 mail logs with .limit(50) and no pagination. For projects that send thousands of emails, users have no way to paginate beyond the most recent 50, making audit/debugging impossible and causing misleading data display in the dashboard.
Steps to Reproduce
- Configure a project that has sent > 50 emails.
- Call GET /api/mail/logs with x-api-key: <sk_live_...>.
- Observe that only the 50 most recent logs are ever returned regardless of page or limit query params.
Expected Behaviour
The endpoint should honour page and limit query parameters (e.g., ?page=2&limit=25) and return a paginated response with total, page, and limit metadata matching the API's standard format.
Actual Behaviour
Response always contains at most 50 records with no total count or pagination cursor, making it impossible for large projects to access older log entries.
Description
In mail.controller.js fetches the last 50 mail logs with .limit(50) and no pagination. For projects that send thousands of emails, users have no way to paginate beyond the most recent 50, making audit/debugging impossible and causing misleading data display in the dashboard.
Steps to Reproduce
Expected Behaviour
The endpoint should honour page and limit query parameters (e.g., ?page=2&limit=25) and return a paginated response with total, page, and limit metadata matching the API's standard format.
Actual Behaviour
Response always contains at most 50 records with no total count or pagination cursor, making it impossible for large projects to access older log entries.