mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
26 lines
772 B
TypeScript
26 lines
772 B
TypeScript
import { Container } from 'typedi';
|
|
import Mail from 'lib/Mail';
|
|
import config from 'config';
|
|
export default class SubscriptionMailMessages {
|
|
/**
|
|
* Send license code to the given mail address.
|
|
* @param {string} licenseCode
|
|
* @param {email} email
|
|
*/
|
|
public async sendMailLicense(licenseCode: string, email: string) {
|
|
const Logger = Container.get('logger');
|
|
|
|
const mail = new Mail()
|
|
.setView('mail/LicenseReceive.html')
|
|
.setSubject('Bigcapital - License code')
|
|
.setTo(email)
|
|
.setData({
|
|
licenseCode,
|
|
successEmail: config.customerSuccess.email,
|
|
successPhoneNumber: config.customerSuccess.phoneNumber,
|
|
});
|
|
|
|
await mail.send();
|
|
Logger.info('[license_mail] sent successfully.');
|
|
}
|
|
} |