Skip to content

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

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#225
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.metrics 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

Supports start_date/end_date/timezone/granularity, metrics and
dimensions (period, domain, email, broadcast) filters, and
domain_id/email_id/broadcast_id filters. List-style params are
comma-joined into the query string as the API expects.
…arams

Add a runtime check (matching this SDK's existing ArgumentError
convention used in contacts.rb/suppressions.rb) since Ruby has no
compile-time way to enforce it. Also add tests for the four invalid
combinations.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread lib/resend/emails.rb Outdated
…blank

Also drops the stray "(beta)" doc comment - this endpoint isn't beta.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread spec/emails_spec.rb Outdated
Comment thread lib/resend/emails.rb
…serting test

Array("") returns [""], not [], so a blank string passed for an
array-style param (metrics/dimensions/domain_id/email_id/broadcast_id)
was still sent as an empty query value. Also the existing regression
test for omitted empty params used `anything` as the query matcher,
so it never actually verified the query was omitted.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (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 a new feature to the Ruby SDK by introducing the Emails.metrics method, which interacts with a new API endpoint.

Re-trigger cubic

@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
@dielduarte
dielduarte merged commit e391d7c into main Aug 24, 2026
8 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