Ir al contenido
v2.7

Actualizar plantilla de correo del proyecto

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

PATCH/project/templates/emailAlcance templates.write

SDK: solo @owbase/node

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

templateId ProjectEmailTemplateId obligatorio

Custom email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification, otpRecovery Valores: 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. Valores: 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.

Acceso: clave de API con el alcance templates.write.

200Éxito
400Parámetro inválido o faltante
401Sin sesión, sin permiso en el recurso o clave sin el alcance
429Límite de peticiones

Todo error llega como JSON con code, type y message: consulta Errores.

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
});
Respuesta200 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"
}

Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?