chore: add email service and password service

This commit is contained in:
mahyargdz
2025-01-20 09:13:27 +03:30
parent 7347a696d0
commit 9701c51445
18 changed files with 10575 additions and 24 deletions
+31
View File
@@ -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,
},
},
}),
};
}