Skip to main content

Creating Templates

Transmit supports both HTML and React Email templates for consistent, reusable email designs.

Using Templates

const response = await client.emails.send({
  from: 'hello@yourdomain.com',
  to: 'user@example.com',
  templateId: 'welcome-email',
  variables: {
    name: 'John Doe',
    confirmationUrl: 'https://example.com/confirm'
  }
});

Template Variables

Use Handlebars syntax in your templates:
<h1>Hello {{name}}!</h1>
<p>Click <a href="{{confirmationUrl}}">here</a> to confirm your email.</p>

React Email Templates

Create type-safe templates with React Email:
import { Button, Html } from '@react-email/components';

export default function WelcomeEmail({ name, confirmationUrl }) {
  return (
    <Html>
      <h1>Hello {name}!</h1>
      <Button href={confirmationUrl}>Confirm Email</Button>
    </Html>
  );
}

Managing Templates

Create and manage templates in the Dashboard.
I