2024-02-28 17:02:46 +08:00
|
|
|
import { ConfigType, registerAs } from '@nestjs/config';
|
2024-02-28 08:32:35 +08:00
|
|
|
|
2024-02-28 17:02:46 +08:00
|
|
|
import { env, envNumber } from '~/global/env';
|
2024-02-28 08:32:35 +08:00
|
|
|
|
2024-02-28 17:02:46 +08:00
|
|
|
export const mailerRegToken = 'mailer';
|
2024-02-28 08:32:35 +08:00
|
|
|
|
|
|
|
export const MailerConfig = registerAs(mailerRegToken, () => ({
|
|
|
|
host: env('SMTP_HOST'),
|
|
|
|
port: envNumber('SMTP_PORT'),
|
|
|
|
ignoreTLS: true,
|
|
|
|
secure: true,
|
|
|
|
auth: {
|
|
|
|
user: env('SMTP_USER'),
|
|
|
|
pass: env('SMTP_PASS'),
|
|
|
|
},
|
2024-02-28 17:02:46 +08:00
|
|
|
}));
|
2024-02-28 08:32:35 +08:00
|
|
|
|
2024-02-28 17:02:46 +08:00
|
|
|
export type IMailerConfig = ConfigType<typeof MailerConfig>;
|