mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
mail.ts uses unified config
This commit is contained in:
parent
21329458e5
commit
9fba6b15e8
|
@ -1,14 +1,16 @@
|
|||
import { createTransport } from "nodemailer"
|
||||
import "dotenv/config"
|
||||
import config from "../../../config.json" assert { type: "json" }
|
||||
import config from "./config.js"
|
||||
import { generateFileId } from "./files.js"
|
||||
|
||||
let mailConfig = config.mail,
|
||||
transport = createTransport({
|
||||
...mailConfig.transport,
|
||||
const { mail } = config
|
||||
const transport = createTransport({
|
||||
host: mail.transport.host,
|
||||
port: mail.transport.port,
|
||||
secure: mail.transport.secure,
|
||||
from: mail.send.from,
|
||||
auth: {
|
||||
user: process.env.MAIL__USER,
|
||||
pass: process.env.MAIL__PASS,
|
||||
user: mail.user,
|
||||
pass: mail.pass,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -23,7 +25,6 @@ export function sendMail(to: string, subject: string, content: string) {
|
|||
return transport.sendMail({
|
||||
to,
|
||||
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
|
||||
.replaceAll(
|
||||
"<span username>",
|
||||
|
|
Loading…
Reference in a new issue