Skip to content

feat: add Emails.Metrics for account-level email metrics - #152

Merged
dielduarte merged 4 commits into
mainfrom
feature/emails-metrics-broadcast-dimension
Aug 24, 2026
Merged

feat: add Emails.Metrics for account-level email metrics#152
dielduarte merged 4 commits into
mainfrom
feature/emails-metrics-broadcast-dimension

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Adds Emails.MetricsWithOptions for account-level email metrics via GET /emails/metricsperiod/domain/email/broadcast dimensions, domain_id/email_id/broadcast_id filters (broadcast and email mutually exclusive), hourly/daily/weekly/monthly granularity.

Mirrors resend/resend-node#1079. Spec: resend/resend-openapi#96

Adds Emails.Metrics/MetricsWithContext/MetricsWithOptions for the
upcoming GET /emails/metrics endpoint. Supports filtering by
domain_id/email_id/broadcast_id and grouping by period/domain/email/
broadcast dimensions, ahead of the endpoint's GA merge.
The email and broadcast dimensions/filters are mutually exclusive per
the API, but MetricsWithOptions sent the request regardless and let a
400 come back. Validate client-side before the request, mirroring the
existing "either/or but not both" pattern in Suppressions.Batch.Remove.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Adds support for the new account-level email metrics API, including new service methods, types, and client-side validation.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This PR adds account-level email metrics support to the SDK. Human review is required to verify the new public API design, response type safety, and the implementation of client-side validation logic.

Re-trigger cubic

Comment thread emails.go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a note on go comments:

Go convention requires a doc comment on every exported identifier (types, consts, struct fields). Tooling like golint/staticcheck flags anything exported without one, and it's how godoc.org-style documentation gets generated. This SDK already did this everywhere before this feature, e.g. EmailTemplate, SendEmailRequest, EmailAttachment and their fields all have the same one-line-per-field doc comments already in emails.go.

@dielduarte
dielduarte marked this pull request as ready for review August 22, 2026 01:36
@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Aug 22, 2026
The emails/metrics slug returns 404. The live page is emails/get-metrics, the same slug the Node SDK links.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: This PR adds account-level email metrics support. Human review is required to verify the new public API surface, response type safety, and the implementation of client-side validation logic.

Re-trigger cubic

@dielduarte
dielduarte merged commit d552c43 into main Aug 24, 2026
10 checks passed
@dielduarte
dielduarte deleted the feature/emails-metrics-broadcast-dimension branch August 24, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants