fix: move mail template to assets folder
parent
81a463e761
commit
e7abc7db13
|
@ -1,6 +1,5 @@
|
|||
import * as nodemailer from 'nodemailer';
|
||||
import * as handlebars from 'handlebars';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { TransactionPaymentType } from 'src/modules/transaction/transaction/constants';
|
||||
import { InvoiceType } from 'src/modules/configuration/export/constants';
|
||||
|
@ -18,11 +17,7 @@ export async function sendEmail(receivers, invoiceType, attachment?) {
|
|||
for (const receiver of receivers) {
|
||||
try {
|
||||
const templateName = getTemplate(receiver.payment_type, invoiceType);
|
||||
let templatePath = path.join(
|
||||
__dirname,
|
||||
`../email-template/${templateName}.html`,
|
||||
);
|
||||
templatePath = templatePath.replace(/dist/g, 'src');
|
||||
const templatePath = `./assets/email-template/${templateName}.html`;
|
||||
const templateSource = fs.readFileSync(templatePath, 'utf8');
|
||||
|
||||
const template = handlebars.compile(templateSource);
|
||||
|
|
Loading…
Reference in New Issue