Skip to content

Conversation

@kewynakshlley
Copy link
Collaborator

@kewynakshlley kewynakshlley commented Oct 27, 2025

Summary by cubic

Introduced a Templates module (beta) to manage email templates via Resend.templates(). Adds typed models and pagination support.

  • New Features
    • Templates service methods: create, get, list (with ListParams), update, remove, duplicate, publish.
    • Operations accept template ID or alias.
    • Models added: Template, TemplateListItem, Variable/VariableType, Create/Update options and responses, Delete/Duplicate/Publish responses.
    • Exposed entry point: Resend.templates().
    • Unit tests covering core flows.

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.

3 issues found across 16 files

Prompt for AI agents (all 3 issues)

Understand the root cause of the following 3 issues and fix them.


<file name="src/main/java/com/resend/services/templates/model/CreateTemplateOptions.java">

<violation number="1" location="src/main/java/com/resend/services/templates/model/CreateTemplateOptions.java:44">
Make a defensive copy of the reply-to list when constructing CreateTemplateOptions so later mutations of the caller&#39;s list don&#39;t bleed into the built request.</violation>

<violation number="2" location="src/main/java/com/resend/services/templates/model/CreateTemplateOptions.java:47">
Copy the variables list when building CreateTemplateOptions so post-build mutations of the source list cannot alter the request options.</violation>
</file>

<file name="src/main/java/com/resend/services/templates/Templates.java">

<violation number="1" location="src/main/java/com/resend/services/templates/Templates.java:91">
Rule violated: **Initialisms and Acronyms Naming Conventions**

`URLHelper` keeps the acronym in all caps, violating the Initialisms and Acronyms Naming Conventions that require camel-casing acronyms (e.g., `UrlHelper`). Please rename the helper and its usages accordingly.</violation>
</file>

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

@kewynakshlley kewynakshlley changed the title feat: implement templates module (beta) feat: Implement templates module (beta) Oct 27, 2025
/**
* Boolean type variable.
*/
BOOLEAN("boolean"),

Choose a reason for hiding this comment

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

We've thought more about the variable types, and we'll go forward without the boolean, object and list types for now. The docs don't reflect this decision yet, but I'll update it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Choose a reason for hiding this comment

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

Thank you!!

@kewynakshlley kewynakshlley merged commit 0d912e8 into main Oct 28, 2025
3 checks passed
@kewynakshlley kewynakshlley deleted the feat/templates branch October 28, 2025 19:06
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