Skip to content

feat: add emails.share() method - #1074

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

feat: add emails.share() method#1074
dielduarte merged 1 commit into
canaryfrom
share-email-link

Conversation

@dielduarte

@dielduarte dielduarte commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Adds emails.share(id, options?), 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.

options.expiresIn is an optional human-readable duration (e.g. 10m, 2 hours, 1 day; server defaults to 48h, capped at 48h).


Summary by cubic

Adds emails.share(id, options?) to generate a shareable link for a sent or received email. Previously there was no SDK method; now clients can create a link with an optional expiration (server defaults to 48h, capped at 48h).

  • Maps options.expiresIn (e.g., "10m", "2 hours", "1 day") to { expires_in } in POST /emails/{id}/share. Returns 422 for malformed or >48h durations, and 404 when the email is not found.
  • Introduces ShareEmailOptions/ShareEmailResponse types and re-exports them. Adds tests for default/custom expiration and error cases.

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

Review in cubic

Adds support for POST /emails/{id}/share, which generates a
shareable link for a sent or received email. Mirrors the
cancel/update email method conventions.
@pkg-pr-new

pkg-pr-new Bot commented Aug 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/resend@1074

commit: efabbe7

@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 4 files

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

Re-trigger cubic

Comment thread src/emails/interfaces/share-email-options.interface.ts
Comment thread src/emails/emails.spec.ts
@dielduarte
dielduarte marked this pull request as ready for review August 20, 2026 12:55
@dielduarte
dielduarte requested a review from a team as a code owner August 20, 2026 12:55
@dielduarte
dielduarte merged commit 5cbb585 into canary Aug 20, 2026
14 checks passed
@dielduarte
dielduarte deleted the share-email-link branch August 20, 2026 13:07
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.

3 participants