2022-01-05 13:48:21 +00:00
|
|
|
const Email = require('vn-print/core/email');
|
2019-11-18 14:04:51 +00:00
|
|
|
|
2022-01-05 13:48:21 +00:00
|
|
|
module.exports = async function(request, response, next) {
|
|
|
|
try {
|
|
|
|
const templateName = request.params.name;
|
|
|
|
const args = response.locals;
|
|
|
|
const email = new Email(templateName, args);
|
|
|
|
await email.send();
|
|
|
|
|
|
|
|
response.status(200).json({
|
|
|
|
message: 'Sent'
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
next(error);
|
|
|
|
}
|
|
|
|
};
|