Obtener plantilla de correo del proyecto
Get a custom email template for the specified locale and type.
/project/templates/email/{templateId}Alcance templates.readSDK: solo @owbase/node
Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details.
Parámetros
Sección titulada «Parámetros»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.
Acceso: clave de API con el alcance templates.read.
Respuestas
Sección titulada «Respuestas»200Éxito400Parámetro inválido o faltante401Sin sesión, sin permiso en el recurso o clave sin el alcance404Recurso de la ruta no encontrado429Límite de peticionesTodo 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.getEmailTemplate({ templateId: ProjectEmailTemplateId.Verification, locale: ProjectEmailTemplateLocale.Af, // optional});curl "https://cloud.owbase.dev/v1/project/templates/email/<TEMPLATE_ID>" \ -H "X-Owbase-Project: <PROJECT_ID>" \ -H "X-Owbase-Key: $OWBASE_API_KEY"{ "templateId": "verification", "locale": "en_us", "message": "Click on the link to verify your account.", "senderName": "My User", "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.