feat: add a docker compose file

This commit is contained in:
Rotimi Best
2024-09-18 04:26:24 +01:00
parent 8a7a9f8370
commit a1e02173aa
4 changed files with 76 additions and 40 deletions
+5 -22
View File
@@ -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();