Renderizar una plantilla con datos de ejemplo
POST
/v1/bulk/templates/preview
const url = 'https://api.mailerdash.com/v1/bulk/templates/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"subject":"example","html":"example","body_text":"example","vars":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.mailerdash.com/v1/bulk/templates/preview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subject": "example", "html": "example", "body_text": "example", "vars": {} }'Devuelve el asunto y el cuerpo ya renderizados, sin guardar nada. Vive en el servidor para que use el MISMO motor que el envio real: una vista previa que renderiza distinto no sirve para lo unico que existe, ver que le va a llegar a la gente.
Authorizations
Sección titulada «Authorizations »Request Body required
Sección titulada «Request Body required » Media type application/json
object
subject
string
html
string
body_text
string
vars
object
Example generated
{ "subject": "example", "html": "example", "body_text": "example", "vars": {}}Responses
Sección titulada « Responses »Contenido renderizado
Media type application/json
object
subject
string
html
string
body_text
string
vars
object
variables
Array<string>
Example generated
{ "subject": "example", "html": "example", "body_text": "example", "vars": {}, "variables": [ "example" ]}No autorizado