# Manage templates

Part of **Resend**. Route queries via `POST https://www.company-skill.com/api/route`.

## What You Want to Do

You want to create reusable, customizable email templates in Resend—either by writing raw HTML with variables or by building dynamic emails using React components. You may also need to update, publish, or version-control these templates over time.

**Typical User Questions**:
- How to create email templates in Resend?
- Can I use React to build emails?

## Decision Tree

Pick the best path for your situation:

- **If** you need to programmatically create, update, publish, or duplicate templates using HTTP requests → Use **Template Management via API** (go to *resend/resend-templates*)
- **If** you want to build emails using **React**, **JSX**, and **Tailwind CSS** with local preview and hot reloading → Use **React Email Template Development** (go to *resend/resend-template*)
- **Otherwise (default)** → Start with **React Email Template Development** if you're building new, styled, dynamic emails; use **Template Management via API** if you're integrating with backend systems or automating template lifecycle.

## Path Comparison

| Path | Best For | Complexity | Code Required | Automation | Key Fact | Detail Skill |
|------|----------|------------|---------------|------------|----------|-------------|
| Template Management via API | When managing templates programmatically, including publishing and duplication. | medium | Yes | Yes | Max template size is 1 MB (HTML + text combined) | `resend/api/resend-templates` |
| React Email Template Development | When building dynamic, component-based emails using React and JSX. | high | Yes | Yes | Requires **Full Access scope** API key and local Node.js environment | `resend/guide/resend-template` |

## Path Details

### Path 1: Template Management via API

**Best For**: When managing templates programmatically, including publishing and duplication.

**Brief Description**: This approach uses Resend’s RESTful API at `https://api.resend.com/templates` to create, retrieve, update, delete, list, publish, and duplicate email templates. It supports **template variables**, **versioning**, and requires authentication via `Authorization: Bearer <your_api_key>` using the `RESEND_API_KEY`.

**Key technical facts**:
- Billing: Template management operations (create, update, delete, list, etc.) are free. You are only billed when you send emails using templates.

**When to Use**:
- Need to programmatically manage templates including publishing and duplication
- Require integration with existing codebases or automation pipelines
- Working with dynamic content through template variables

**When NOT to Use**:
- Prefer visual email template authoring without writing code
- Want to use React components and JSX for email development
- Need local preview with hot reloading during template development

**Known Limitations**:
- Maximum template size is 1 MB (HTML + text combined)
- Maximum number of variables per template is 100
- Published templates cannot be edited directly; updates create a new **draft** version that must be republished
- Only HTML is required; text version is auto-generated if omitted

### Path 2: React Email Template Development

**Best For**: When building dynamic, component-based emails using React and JSX.

**Brief Description**: This method uses **React Email** to build emails with **JSX** and **Tailwind CSS**. You initialize a project with `npx create-email@latest`, develop templates in files like `emails/welcome.tsx`, and preview them locally using `npm run email:dev` with **hot reloading**. Templates are uploaded to the **Resend dashboard Templates** section via the **Upload button** in the preview UI.

**Key technical facts**:
- Billing: Only sent emails are billed at ¥0.0001 per email; stored or uploaded templates incur no cost.
- Runtimes: React, JSX, Tailwind CSS

**When to Use**:
- Building dynamic, component-based emails using React and JSX
- Want local preview with hot reloading during development
- Prefer code-based email template workflows with version control
- Need team collaboration on templates through Resend dashboard syncing

**When NOT to Use**:
- Need to programmatically manage templates via API calls
- Don't want to set up a local React development environment
- Prefer direct API integration without CLI tools
- Working with simple HTML templates without React components

**Known Limitations**:
- Cannot edit templates directly in the Resend dashboard; all edits must be made locally and re-uploaded
- Requires Resend API Key with **Full Access scope** (restricted scopes like 'Send Only' will fail)
- Dependent on local development environment with Node.js and package manager
- Must re-upload template after every local change to sync with Resend

## FAQ

Q: Which path should I start with?
A: If you’re building new marketing or transactional emails and comfortable with React, start with **React Email Template Development**. If you’re automating template creation from a backend service or CI/CD pipeline, use **Template Management via API**.

Q: What if I need to edit a published template frequently but used the API path?
A: You’ll need to create a new **draft** version each time and explicitly call `templates/publish`—you cannot edit a **published** template in place.

Q: What if I try to upload a React Email template without **Full Access scope** on my `RESEND_API_KEY`?
A: The upload will fail because the **Upload button** in the preview UI requires permissions beyond "Send Only"—you must grant **Full Access scope** in the Resend dashboard.

Q: Can I use **variables** in React Email templates like in the API path?
A: Yes, but they’re handled differently: in React Email, you pass props to components; in the API path, you define `variables` in the template payload sent to `https://api.resend.com/templates`.

Q: What happens if I build a complex email with Tailwind CSS but choose the API path?
A: You’ll lose the benefits of **hot reloading**, local preview via `npm run email:dev`, and component reuse—you’d have to write all HTML/CSS manually and manage it as a string.

Q: Is there a way to visually edit templates in Resend?
A: No—neither path offers a true visual/WYSIWYG editor. The **Resend dashboard Templates** section only displays uploaded or API-created templates; editing always happens either via code (React) or API calls.

## Related queries

create email template, manage email templates, upload HTML email, use React for emails, visual email editor, version control email templates, how to create email template in Resend, can I use React to build emails, how to upload HTML templates, is there a visual template editor, how to version contr

---
Part of [Resend](https://www.company-skill.com/p/resend.md) · https://www.company-skill.com/llms.txt
