feat: add emails.share() method - #127
Merged
Merged
Conversation
Adds support for the new POST /emails/{id}/share endpoint, which
creates a shareable link for a sent or received email. Mirrors the
existing cancel/update conventions: a ShareEmailOptions builder for
the optional expires_in field and a ShareEmailResponse carrying the
returned url.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
dielduarte
marked this pull request as ready for review
August 20, 2026 15:07
kewynakshlley
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
resend.emails().share(id)/share(id, ShareEmailOptions), calling the newPOST /emails/{id}/shareendpoint that creates a shareable link for a sent or received email. See the spec PR resend/resend-openapi#92.ShareEmailOptions.expiresInis an optional human-readable duration (e.g.10m,2 hours,1 day; server defaults to48h, capped at 48h).Summary by cubic
Adds emails.share() to create a shareable link for a sent or received email. Previously there was no way to generate a share URL; now
share(emailId[, options])returns aurlwith a default 48h expiry, or a custom expiry up to 48h.share(String emailId)andshare(String emailId, ShareEmailOptions)callingPOST /emails/{id}/sharewith an empty or JSON body (expires_in).ShareEmailOptions(builder withexpiresInhuman-readable duration) andShareEmailResponse(extendsEmailResponse, addsurl).ResendExceptionwith status/body; tests cover default/custom expiry, 422 when expiry exceeds 48h, and 404 not found.Written for commit 9547792. Summary will update on new commits.