Compare commits
2 Commits
81a463e761
...
79d1c564ff
Author | SHA1 | Date |
---|---|---|
|
79d1c564ff | |
|
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);
|
||||
|
|
|
@ -8,6 +8,7 @@ import { FormulaType } from 'src/modules/transaction/sales-price-formula/constan
|
|||
import { STATUS } from 'src/core/strings/constants/base.constants';
|
||||
import { TransactionModel } from '../../../data/models/transaction.model';
|
||||
import { mappingRevertTransaction } from '../managers/helpers/mapping-transaction.helper';
|
||||
import { apm } from '../../../../../../core/apm';
|
||||
|
||||
@EventsHandler(ChangeDocEvent)
|
||||
export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
||||
|
@ -77,6 +78,7 @@ export class PosTransactionHandler implements IEventHandler<ChangeDocEvent> {
|
|||
await this.dataService.create(queryRunner, TransactionModel, data);
|
||||
}
|
||||
} catch (error) {
|
||||
apm.captureError(error);
|
||||
console.log('error handling pos transaction couch');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue