added mail service

This commit is contained in:
2024-04-10 21:24:25 +03:00
parent c76d4b9717
commit 78107d4ec7
80 changed files with 3478 additions and 329 deletions

16
config/mailer.ts Normal file
View File

@@ -0,0 +1,16 @@
import { env } from 'process'
import SMTPTransport from 'nodemailer/lib/smtp-transport'
export const from: string = `"${env.MAIL_SERVER_SENDER_NAME}" <${env.MAIL_SERVER_USERNAME}>`
export const transportOptions: SMTPTransport | SMTPTransport.Options | string = {
host: env.MAIL_SERVER_HOST,
debug: env.MAIL_SERVER_DEBUG === 'true',
logger: env.MAIL_SERVER_LOG === 'true',
port: parseInt(env.MAIL_SERVER_PORT as string),
secure: env.MAIL_SERVER_PORT === '465', // Use `true` for port 465, `false` for all other ports
auth: {
user: env.MAIL_SERVER_USERNAME, pass: env.MAIL_SERVER_PASSWORD,
},
}