Skip to content

[Bug] mail.controller: getMailLogs returns hardcoded 50 records with no pagination support #284

@Kirtan-pc

Description

@Kirtan-pc

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

  1. Configure a project that has sent > 50 emails.
  2. Call GET /api/mail/logs with x-api-key: <sk_live_...>.
  3. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions