mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
refactor: Authentication service.
This commit is contained in:
@@ -2,7 +2,6 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import Mustache from 'mustache';
|
||||
import { Container } from 'typedi';
|
||||
import mail from '@/services/mail';
|
||||
|
||||
export default class SubscriptionMailMessages {
|
||||
/**
|
||||
@@ -11,7 +10,8 @@ export default class SubscriptionMailMessages {
|
||||
* @param {email} email
|
||||
*/
|
||||
public async sendMailVoucher(voucherCode: string, email: string) {
|
||||
const logger = Container.get('logger');
|
||||
const Logger = Container.get('logger');
|
||||
const Mail = Container.get('mail');
|
||||
|
||||
const filePath = path.join(global.rootPath, 'views/mail/VoucherReceive.html');
|
||||
const template = fs.readFileSync(filePath, 'utf8');
|
||||
@@ -24,7 +24,7 @@ export default class SubscriptionMailMessages {
|
||||
html: rendered,
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
mail.sendMail(mailOptions, (error) => {
|
||||
Mail.sendMail(mailOptions, (error) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user