mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
refactor: inventory to nestjs
This commit is contained in:
@@ -5,29 +5,26 @@ import { MAIL_TRANSPORTER_PROVIDER } from './Mail.constants';
|
||||
import { MailTransporter } from './MailTransporter.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
providers: [
|
||||
{
|
||||
module: MailModule,
|
||||
providers: [
|
||||
{
|
||||
provide: MAIL_TRANSPORTER_PROVIDER,
|
||||
useFactory: (configService: ConfigService) => {
|
||||
// Create reusable transporter object using the default SMTP transport
|
||||
const transporter = createTransport({
|
||||
host: configService.get('mail.host'),
|
||||
port: configService.get('mail.port'),
|
||||
secure: configService.get('mail.secure'), // true for 465, false for other ports
|
||||
auth: {
|
||||
user: configService.get('mail.username'),
|
||||
pass: configService.get('mail.password'),
|
||||
},
|
||||
});
|
||||
return transporter;
|
||||
provide: MAIL_TRANSPORTER_PROVIDER,
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService) => {
|
||||
// Create reusable transporter object using the default SMTP transport
|
||||
const transporter = createTransport({
|
||||
host: configService.get('mail.host'),
|
||||
port: configService.get('mail.port'),
|
||||
secure: configService.get('mail.secure'), // true for 465, false for other ports
|
||||
auth: {
|
||||
user: configService.get('mail.username'),
|
||||
pass: configService.get('mail.password'),
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
return transporter;
|
||||
},
|
||||
},
|
||||
MailTransporter
|
||||
MailTransporter,
|
||||
],
|
||||
exports: [MAIL_TRANSPORTER_PROVIDER, MailTransporter],
|
||||
})
|
||||
export class MailModule {}
|
||||
|
||||
Reference in New Issue
Block a user