Skip to content

feat: add publish method#574

Merged
CarolinaMoraes merged 11 commits intopreview-templatesfrom
feature/product-403-add-publish-method
Aug 22, 2025
Merged

feat: add publish method#574
CarolinaMoraes merged 11 commits intopreview-templatesfrom
feature/product-403-add-publish-method

Conversation

@CarolinaMoraes
Copy link
Contributor

@CarolinaMoraes CarolinaMoraes commented Aug 20, 2025

Summary by cubic

Adds a publish method to Templates to publish a template by ID and return a typed result. Supports Product-403.

  • New Features
    • PublishTemplateResponse types for success/error.
    • POST /templates/{id}/publish wired in Templates.publish().
    • Tests for 200 success and 404 not_found cases.

@CarolinaMoraes CarolinaMoraes requested a review from a team as a code owner August 20, 2025 16:33
@CarolinaMoraes CarolinaMoraes requested review from pedro-stramantinoli and removed request for a team August 20, 2025 16:33
@CarolinaMoraes CarolinaMoraes self-assigned this Aug 20, 2025
Copy link
Member

@joaopcm joaopcm left a comment

Choose a reason for hiding this comment

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

In order to make the experience of using our SDK smoother, what do you think of implementing additional methods for create, update, and duplicate? I was thinking of something like this:

Create

await resend.templates.create(/** ... */).publish()

Update

await resend.templates.update(/** ... */).publish()

Duplicate

await resend.templates.duplicate(/** ... */).publish()

Instead of having to call the SDK twice for these operations, like:

await resend.templates.create(/** ... */);
await resend.templates.publish(/** ... */);

What do you think?

@CarolinaMoraes
Copy link
Contributor Author

@joaopcm I loove this idea! I will start working on it

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@CarolinaMoraes CarolinaMoraes changed the base branch from preview-templates to canary August 22, 2025 13:47
@CarolinaMoraes CarolinaMoraes changed the base branch from canary to preview-templates August 22, 2025 13:48
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📢: This approach was reviewed on #575
Feel free to add new questions about it, but also be mindful of the ones that were answered there

@CarolinaMoraes CarolinaMoraes merged commit 53815c2 into preview-templates Aug 22, 2025
7 checks passed
@CarolinaMoraes CarolinaMoraes deleted the feature/product-403-add-publish-method branch August 22, 2025 14:02
CarolinaMoraes added a commit that referenced this pull request Aug 25, 2025
CarolinaMoraes added a commit that referenced this pull request Sep 29, 2025
CarolinaMoraes added a commit that referenced this pull request Sep 29, 2025
CarolinaMoraes added a commit that referenced this pull request Sep 29, 2025
CarolinaMoraes added a commit that referenced this pull request Sep 29, 2025
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