Skip to content

feat(broadcasts): add recipients command - #369

Merged
dielduarte merged 3 commits into
mainfrom
feat/broadcasts-recipients
Aug 24, 2026
Merged

feat(broadcasts): add recipients command#369
dielduarte merged 3 commits into
mainfrom
feat/broadcasts-recipients

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Adds `resend broadcasts recipients ` for GET /broadcasts/{id}/recipients.

Tests: 1114 passed. Lint/typecheck clean.


Summary by cubic

Adds resend broadcasts recipients <id> to list a broadcast’s recipients by event type, enabling recipient inspection that was previously not possible. Uses resend 6.22.0 to call broadcasts.recipients().

  • Flags: --type is required (non-interactive) with sent|delivered|opened|clicked|bounced|complained|unsubscribed|suppressed. Optional --email (substring filter) and --bounce-type (permanent|transient|undetermined, only meaningful with --type bounced).
  • Pagination and UX: supports --limit (1–100, default 20), --after, --before. Interactive mode prints a table and pagination hints; hints do not shell-quote --email. Table renders missing counts as -.
  • Output and docs/tests: non-interactive returns the JSON list (type-specific fields like count, bounce_type, clicked_links). Adds docs and tests for validation, pagination, and SDK errors. Note: responses may be cached for up to 15 minutes.

Written for commit 3e42538. Summary will update on new commits.

Review in cubic

@dielduarte
dielduarte marked this pull request as ready for review August 23, 2026 02:51

@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.

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/commands/broadcasts/recipients.test.ts">

<violation number="1" location="tests/commands/broadcasts/recipients.test.ts:138">
P3: The interactive path is never exercised: every test forces non-interactive mode (setupOutputSpies/setNonInteractive), so the table rendering (renderBroadcastRecipientsTable) and the pagination-hint branch of printPaginationHint called from the recipients command are untested. The mock also always returns has_more:false. Add one test with isTTY true (interactive) and has_more:true asserting the table output and the ‘Fetch the next page’ hint including --type/--limit flags.</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread src/commands/broadcasts/recipients.ts
Comment thread src/commands/broadcasts/recipients.ts
Comment thread tests/commands/broadcasts/recipients.test.ts
Comment thread skills/resend-cli/references/broadcasts.md Outdated
Comment thread src/commands/broadcasts/utils.ts Outdated
Comment thread src/commands/broadcasts/recipients.ts

@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 (changes from recent commits).

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

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/broadcasts/recipients.ts Outdated

@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 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread src/commands/broadcasts/recipients.ts
@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Aug 23, 2026
'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6',
'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"',
'resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6',
'resend broadcasts recipients d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --type opened',

@gabrielmfern gabrielmfern Aug 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i don't think we can do much about this, or have another option, and this is probably the pattern for the other commands, but it feels slightly weird to put the broadcast ID right after the recipients command

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.

yeah, I think in this case worth a redesign of all commands to actually receive it as --broadcast-id param? I also found it not very intuitive. but would be a breaking change how other commands are working, still worth a major version updating it, not the best API design.

List a broadcast's recipients filtered by event type (sent, delivered,
opened, clicked, bounced, complained, unsubscribed, suppressed), with
optional email substring and bounce-type filters plus cursor pagination.

Bumps the resend dependency to 6.22.0, which introduces
broadcasts.recipients().
@dielduarte
dielduarte force-pushed the feat/broadcasts-recipients branch from 0210d86 to 3e42538 Compare August 24, 2026 15:29
@dielduarte
dielduarte merged commit d1409ac into main Aug 24, 2026
7 of 8 checks passed
@dielduarte
dielduarte deleted the feat/broadcasts-recipients branch August 24, 2026 15:31
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