Skip to content
v2.7

Update project email template

Update a custom email template for the specified locale and type.

PATCH/project/templates/emailScope templates.write

SDK: @owbase/node only

Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.

templateId ProjectEmailTemplateId required

Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery Values: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery.

locale ProjectEmailTemplateLocale

Custom email template locale. If left empty, the fallback locale (en) will be used. Values: af, ar-ae, ar-bh, ar-dz, ar-eg, ar-iq, ar-jo, ar-kw, ar-lb, ar-ly, ar-ma, ar-om, ar-qa, ar-sa, ar-sy, ar-tn, ar-ye, as, az, be, bg, bh, bn, bs, ca, cs, cy, da, de, de-at, de-ch, de-li, de-lu, el, en, en-au, en-bz, en-ca, en-gb, en-ie, en-jm, en-nz, en-tt, en-us, en-za, eo, es, es-ar, es-bo, es-cl, es-co, es-cr, es-do, es-ec, es-gt, es-hn, es-mx, es-ni, es-pa, es-pe, es-pr, es-py, es-sv, es-uy, es-ve, et, eu, fa, fi, fo, fr, fr-be, fr-ca, fr-ch, fr-lu, ga, gd, he, hi, hr, hu, id, is, it, it-ch, ja, ji, ko, ku, lt, lv, mk, ml, ms, mt, nb, ne, nl, nl-be, nn, no, pa, pl, pt, pt-br, rm, ro, ro-md, ru, ru-md, sb, sk, sl, sq, sr, sv, sv-fi, th, tn, tr, ts, ua, ur, ve, vi, xh, zh-cn, zh-hk, zh-sg, zh-tw, zu.

subject string

Subject of the email template. Can be up to 255 characters.

message string

Plain or HTML body of the email template message. Can be up to 10MB of content.

senderName string

Name of the email sender.

senderEmail string

Email of the sender. Pass an empty string to clear a previously set value.

replyToEmail string

Reply to email. Pass an empty string to clear a previously set value.

replyToName string

Reply to name.

Access: API key with the templates.write scope.

200Success
400Invalid or missing parameter
401No session, no permission on the resource or key without the scope
429Rate limit

Every error comes as JSON with code, type and message: see Errors.

import { Client, Project, ProjectEmailTemplateId, ProjectEmailTemplateLocale } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
const project = new Project(client);
const result = await project.updateEmailTemplate({
templateId: ProjectEmailTemplateId.Verification,
locale: ProjectEmailTemplateLocale.Af, // optional
subject: '<SUBJECT>', // optional
message: '<MESSAGE>', // optional
senderName: '<SENDER_NAME>', // optional
senderEmail: '[email protected]', // optional
replyToEmail: '[email protected]', // optional
replyToName: '<REPLY_TO_NAME>', // optional
});
Response200 OK
{
"templateId": "verification",
"locale": "en_us",
"message": "Click on the link to verify your account.",
"senderName": "My User",
"senderEmail": "[email protected]",
"replyToEmail": "[email protected]",
"replyToName": "Support Team",
"subject": "Please verify your email address"
}

The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.

Was this page helpful?