Skip to content

feat: add Emails.share method - #221

Merged
dielduarte merged 1 commit into
mainfrom
share-email-link
Aug 20, 2026
Merged

feat: add Emails.share method#221
dielduarte merged 1 commit into
mainfrom
share-email-link

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Adds Resend::Emails.share(email_id, params = {}), calling the new POST /emails/{id}/share endpoint that creates a shareable link for a sent or received email. See the spec PR resend/resend-openapi#92.

params[:expires_in] is an optional human-readable duration (e.g. 10m, 2 hours, 1 day; server defaults to 48h, capped at 48h).


Summary by cubic

Add Resend::Emails.share to create a shareable link for a sent or received email via POST /emails/{id}/share. Previously you could not generate share links; now you can optionally set expires_in with a human-readable duration. The server defaults to 48h and caps at 48h.

  • Posts to emails/{id}/share; includes a body only when expires_in is provided.
  • Returns id and url. Maps validation and not found responses to existing Resend::Error classes.
  • Specs cover default expiry, custom expires_in ("10m"), invalid durations (>48h), and missing email (404).
  • No breaking changes or configuration.

Written for commit a5f2467. Summary will update on new commits.

Review in cubic

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

No issues found across 2 files

Confidence score: 5/5

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

Auto-approved: Adds Resend::Emails.share to create a shareable email link via POST /emails/{id}/share. It's a minimal, well-tested, non-breaking addition with no auth/config/security impact.

Re-trigger cubic

Approval not submitted

This repository is configured to approve as @klotty, but that approval identity is unavailable.
The refresh token passed is incorrect or expired.

cubic left this as a normal review comment instead of falling back to a Cubic App approval.

@dielduarte
dielduarte marked this pull request as ready for review August 20, 2026 15:04
@dielduarte
dielduarte merged commit c5e026e into main Aug 20, 2026
8 checks passed
@dielduarte
dielduarte deleted the share-email-link branch August 20, 2026 22:51
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