Fixed Mailer

This commit is contained in:
2025-09-29 20:49:29 +02:00
parent 22ce0d6e7a
commit 4588c2b9e9
2 changed files with 4 additions and 1 deletions

View File

@@ -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) => {

View File

@@ -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(