import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.templates.update(
'34a080c9-b17d-4187-ad80-5af20266e535',
{
name: 'order-confirmation',
html: '<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>',
},
);
{
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"object": "template"
}
Update a template.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.templates.update(
'34a080c9-b17d-4187-ad80-5af20266e535',
{
name: 'order-confirmation',
html: '<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>',
},
);
{
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"object": "template"
}
"Your Name <sender@domain.com>".If provided, this value can be overridden when sending an email using the template.Hide properties
PRODUCT_NAME). The following variable names are reserved and cannot be used:
FIRST_NAME, LAST_NAME, EMAIL, RESEND_UNSUBSCRIBE_URL, contact, and this.'string' or 'number'import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.templates.update(
'34a080c9-b17d-4187-ad80-5af20266e535',
{
name: 'order-confirmation',
html: '<p>Total: {{{PRICE}}}</p><p>Name: {{{PRODUCT}}}</p>',
},
);
{
"id": "34a080c9-b17d-4187-ad80-5af20266e535",
"object": "template"
}
Was this page helpful?