15 lines
424 B
JavaScript
15 lines
424 B
JavaScript
const Email = require('vn-print/core/email');
|
|
|
|
module.exports = async function(request, response, next) {
|
|
try {
|
|
const templateName = request.params.name;
|
|
const args = Object.assign({isPreview: true}, response.locals);
|
|
const email = new Email(templateName, args);
|
|
const template = await email.render();
|
|
|
|
response.send(template);
|
|
} catch (error) {
|
|
next(error);
|
|
}
|
|
};
|