chore: add email service and password service
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { ConfigService } from "@nestjs/config";
|
||||
import { HandlebarsAdapter } from "@nestjs-modules/mailer/dist/adapters/handlebars.adapter";
|
||||
import { MailerAsyncOptions } from "@nestjs-modules/mailer/dist/interfaces/mailer-async-options.interface";
|
||||
|
||||
export function mailerConfig(): MailerAsyncOptions {
|
||||
return {
|
||||
inject: [ConfigService],
|
||||
useFactory: (configService: ConfigService) => ({
|
||||
transport: {
|
||||
host: configService.get("SMTP_HOST"),
|
||||
port: configService.get("SMTP_PORT"),
|
||||
secure: false,
|
||||
auth: {
|
||||
user: configService.get("SMTP_USER"),
|
||||
pass: configService.get("SMTP_PASS"),
|
||||
},
|
||||
},
|
||||
defaults: {
|
||||
from: configService.get("MAIL_FROM"),
|
||||
},
|
||||
|
||||
template: {
|
||||
dir: __dirname + "/templates",
|
||||
adapter: new HandlebarsAdapter(),
|
||||
options: {
|
||||
strict: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user