UNPKG

zync-nest-library

Version:

NestJS library with database backup and file upload utilities

27 lines (24 loc) 658 B
import { MailerService } from "@nestjs-modules/mailer"; import { Injectable } from "@nestjs/common"; import { IMail, IMailerConfig, MailOrderType } from "./mailer.interface"; import { ConfigService } from "@nestjs/config"; @Injectable() export class MailService { public config: IMailerConfig; constructor( private mailerService: MailerService, private configService: ConfigService ) { this.config = this.configService.get("mailer"); } public async send(mail: IMail) { try { await this.mailerService.sendMail({ ...mail, context: { ...mail.context, }, }); } catch (error) {} } }