const Component = require(`${appPath}/core/component`); const emailHeader = new Component('email-header'); const emailFooter = new Component('email-footer'); const db = require(`${appPath}/core/database`); module.exports = { name: 'delivery-note', methods: { fetchTicket(ticketId) { return db.findOne(` SELECT t.id, u.lang locale, c.email recipient FROM ticket t JOIN client c ON c.id = t.clientFk JOIN account.user u ON u.id = c.id WHERE t.id = ?`, [ticketId]); }, }, components: { 'email-header': emailHeader.build(), 'email-footer': emailFooter.build() }, props: { ticketId: { required: true } } };