mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-22 05:46:26 -08:00
mail.ts uses unified config
This commit is contained in:
parent
21329458e5
commit
9fba6b15e8
|
@ -1,16 +1,18 @@
|
||||||
import { createTransport } from "nodemailer"
|
import { createTransport } from "nodemailer"
|
||||||
import "dotenv/config"
|
import config from "./config.js"
|
||||||
import config from "../../../config.json" assert { type: "json" }
|
|
||||||
import { generateFileId } from "./files.js"
|
import { generateFileId } from "./files.js"
|
||||||
|
|
||||||
let mailConfig = config.mail,
|
const { mail } = config
|
||||||
transport = createTransport({
|
const transport = createTransport({
|
||||||
...mailConfig.transport,
|
host: mail.transport.host,
|
||||||
auth: {
|
port: mail.transport.port,
|
||||||
user: process.env.MAIL__USER,
|
secure: mail.transport.secure,
|
||||||
pass: process.env.MAIL__PASS,
|
from: mail.send.from,
|
||||||
},
|
auth: {
|
||||||
})
|
user: mail.user,
|
||||||
|
pass: mail.pass,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Sends an email
|
* @description Sends an email
|
||||||
|
@ -23,7 +25,6 @@ export function sendMail(to: string, subject: string, content: string) {
|
||||||
return transport.sendMail({
|
return transport.sendMail({
|
||||||
to,
|
to,
|
||||||
subject,
|
subject,
|
||||||
from: mailConfig.send.from,
|
|
||||||
html: `<span style="font-size:x-large;font-weight:600;">monofile <span style="opacity:0.5">accounts</span></span><br><span style="opacity:0.5">Gain control of your uploads.</span><hr><br>${content
|
html: `<span style="font-size:x-large;font-weight:600;">monofile <span style="opacity:0.5">accounts</span></span><br><span style="opacity:0.5">Gain control of your uploads.</span><hr><br>${content
|
||||||
.replaceAll(
|
.replaceAll(
|
||||||
"<span username>",
|
"<span username>",
|
||||||
|
|
Loading…
Reference in a new issue