feat: add a docker compose file
This commit is contained in:
@@ -1,29 +1,12 @@
|
||||
const { SendMailClient } = require('zeptomail');
|
||||
const nodemailer = require('nodemailer');
|
||||
|
||||
const {
|
||||
ZOHO_TOKEN,
|
||||
SMTP_HOST,
|
||||
SMTP_PORT,
|
||||
SMTP_USER,
|
||||
SMTP_PASSWORD,
|
||||
SMTP_USER_NOTIFY,
|
||||
SMTP_PASSWORD_NOTIFY
|
||||
} = process.env;
|
||||
|
||||
console.log({ ZOHO_TOKEN });
|
||||
const { ZOHO_TOKEN, SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD } = process.env;
|
||||
|
||||
const zohoClient = new SendMailClient({ url: 'api.zeptomail.eu/', token: ZOHO_TOKEN });
|
||||
|
||||
const nodemailerTransporter = async (isPersonal = false) => {
|
||||
if (
|
||||
!SMTP_HOST ||
|
||||
!SMTP_PORT ||
|
||||
!SMTP_USER ||
|
||||
!SMTP_PASSWORD ||
|
||||
!SMTP_USER_NOTIFY ||
|
||||
!SMTP_PASSWORD_NOTIFY
|
||||
) {
|
||||
const nodemailerTransporter = async () => {
|
||||
if (!SMTP_HOST || !SMTP_PORT || !SMTP_USER || !SMTP_PASSWORD) {
|
||||
console.error('SMTP configuration missing');
|
||||
return null;
|
||||
}
|
||||
@@ -34,8 +17,8 @@ const nodemailerTransporter = async (isPersonal = false) => {
|
||||
port: parseInt(SMTP_PORT || '465', 10),
|
||||
secure: true,
|
||||
auth: {
|
||||
user: isPersonal ? SMTP_USER : SMTP_USER_NOTIFY,
|
||||
pass: isPersonal ? SMTP_PASSWORD : SMTP_PASSWORD_NOTIFY
|
||||
user: SMTP_USER,
|
||||
pass: SMTP_PASSWORD
|
||||
}
|
||||
});
|
||||
await transporter.verify();
|
||||
|
||||
Reference in New Issue
Block a user