Fixed Mailer
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user