From 4588c2b9e96346161e529969cc12c1fa7b529bac Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Mon, 29 Sep 2025 20:49:29 +0200 Subject: [PATCH] Fixed Mailer --- src/index.ts | 2 ++ src/utils/mailer.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 0ca61c6..0040ea7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,11 +23,13 @@ import emailAsUserRoutes from "./routes/emailAsUser"; import {sendMail} from "./utils/mailer"; import {loadSecrets, secrets} from "./utils/secrets"; +import {initMailer} from "./utils/mailer" import {initS3} from "./utils/s3"; async function main() { const app = Fastify({ logger: true }); await loadSecrets(); + await initMailer(); await initS3(); /*app.addHook("onRequest", (req, reply, done) => { diff --git a/src/utils/mailer.ts b/src/utils/mailer.ts index 1fbed85..ce52288 100644 --- a/src/utils/mailer.ts +++ b/src/utils/mailer.ts @@ -2,7 +2,7 @@ import nodemailer from "nodemailer" import {secrets} from "./secrets" export let transporter = null -export const loadMailer = async () => { +export const initMailer = async () => { transporter = nodemailer.createTransport({ host: secrets.MAILER_SMTP_HOST, port: Number(secrets.MAILER_SMTP_PORT) || 587, @@ -12,6 +12,7 @@ export const loadMailer = async () => { pass: secrets.MAILER_SMTP_PASS, }, }) + console.log("Mailer Initialized!") } export async function sendMail(