Skip to content

feat: add Batch.SendParams with tags support#236

Closed
cpenned wants to merge 4 commits into
mainfrom
cursor/batch-send-params-3669
Closed

feat: add Batch.SendParams with tags support#236
cpenned wants to merge 4 commits into
mainfrom
cursor/batch-send-params-3669

Conversation

@cpenned

@cpenned cpenned commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The batch send API supports tags per email. This PR adds a dedicated Batch.SendParams type that reflects the batch API surface.

Changes

  • Add _BatchSendParamsDefault TypedDict for batch email parameters
  • Add Batch.SendParams with explicit documentation for tags
  • Update Batch.send / Batch.send_async signatures to accept List[Batch.SendParams]
  • Document scheduled_at on Emails.SendParams (was present in the TypedDict but missing from docs)
  • Add a test verifying tags are serialized in the batch request payload
  • Update batch examples and tests to use Batch.SendParams
Open in Web Open in Cursor 

Summary by cubic

Introduces a dedicated Batch.SendParams for batch sends with per-email tags, and clarifies that batch requests do not support attachments or scheduled_at. Updates method signatures, examples, and tests, and documents scheduled_at on Emails.SendParams.

  • New Features

    • Added Batch.SendParams (tags only); documented that batch excludes attachments and scheduled_at; removed attachment references from batch docs; documented scheduled_at on Emails.SendParams.
    • Updated Batch.send/Batch.send_async to accept List[Batch.SendParams]; examples updated; tests added (including tags serialization).
  • Migration

    • Replace List[resend.Emails.SendParams] with List[resend.Batch.SendParams] when calling Batch.send or Batch.send_async.

Written for commit 57f72b8. Summary will update on new commits.

Review in cubic

cursoragent and others added 2 commits July 10, 2026 20:54
Introduce a dedicated Batch.SendParams type for batch email sends so
scheduled_at, tags, and attachments are explicitly documented and typed.
Update batch send signatures, tests, and examples to use the new type.

Co-authored-by: cpenned <cpenned@users.noreply.github.com>
Co-authored-by: cpenned <cpenned@users.noreply.github.com>
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jul 10, 2026

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

Auto-approved: Adds a new TypedDict subclass, updates type annotations, and adds a test. No runtime logic changes, just explicit typing and documentation.

Re-trigger cubic

Exclude attachments and scheduled_at from the batch send type since
only tags are supported on batch emails. Use a dedicated
_BatchSendParamsDefault TypedDict to reflect API limitations.

Co-authored-by: cpenned <cpenned@users.noreply.github.com>
@cursor cursor Bot changed the title feat: add Batch.SendParams with scheduled_at, tags, and attachments feat: add Batch.SendParams with tags support Jul 13, 2026

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

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="resend/emails/_emails.py">

<violation number="1" location="resend/emails/_emails.py:137">
P2: The `_BatchSendParamsDefault` class duplicates ~10 fields with identical types and docstrings from `_SendParamsDefault`. If a common field like `to`, `html`, or `tags` ever changes its type signature or docstring, both classes need updating — a real maintenance trap.

Consider extracting a shared base (e.g., `_SendParamsCommon`) with the common fields so that `_SendParamsDefault` adds only `attachments` and `scheduled_at`, and `_BatchSendParamsDefault` inherits the rest without duplication.</violation>
</file>

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

Re-trigger cubic

Comment thread resend/emails/_emails.py
"""


class _BatchSendParamsDefault(_SendParamsFrom):

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.

P2: The _BatchSendParamsDefault class duplicates ~10 fields with identical types and docstrings from _SendParamsDefault. If a common field like to, html, or tags ever changes its type signature or docstring, both classes need updating — a real maintenance trap.

Consider extracting a shared base (e.g., _SendParamsCommon) with the common fields so that _SendParamsDefault adds only attachments and scheduled_at, and _BatchSendParamsDefault inherits the rest without duplication.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At resend/emails/_emails.py, line 137:

<comment>The `_BatchSendParamsDefault` class duplicates ~10 fields with identical types and docstrings from `_SendParamsDefault`. If a common field like `to`, `html`, or `tags` ever changes its type signature or docstring, both classes need updating — a real maintenance trap.

Consider extracting a shared base (e.g., `_SendParamsCommon`) with the common fields so that `_SendParamsDefault` adds only `attachments` and `scheduled_at`, and `_BatchSendParamsDefault` inherits the rest without duplication.</comment>

<file context>
@@ -134,6 +134,49 @@ class _SendParamsDefault(_SendParamsFrom):
     """
 
 
+class _BatchSendParamsDefault(_SendParamsFrom):
+    to: Union[str, List[str]]
+    """
</file context>

@cubic-dev-ai cubic-dev-ai Bot dismissed their stale review July 13, 2026 16:20

Dismissed because Cubic found issues in a newer review.

Co-authored-by: cpenned <cpenned@users.noreply.github.com>

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

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@cpenned cpenned closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants