Updated the email.ts util

This commit is contained in:
Mathias Wagner 2023-06-18 14:59:32 +02:00
parent 848327b922
commit c1d6b736ef
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -3,7 +3,8 @@ import { Options } from "nodemailer/lib/mailer";
import * as process from "process";
const transport = createTransport({
service: process.env.MAIL_SERVICE || "gmail",
host: process.env.MAIL_SERVER || "smtp.gmail.com",
port: parseInt(process.env.MAIL_PORT || "587"),
auth: {
user: process.env.MAIL_USER || "noreply@licenseapi.de",
pass: process.env.MAIL_PASS,
@ -11,7 +12,7 @@ const transport = createTransport({
});
export const sendMail = (options: Options, success?: (info: SentMessageInfo) => void, error?: (msg: Error) => void) => transport.sendMail({
...options, from: process.env.USER || "noreply@licenseapi.de",
...options, from: process.env.MAIL_USER || "noreply@licenseapi.de",
}, (err, info) => {
if (err !== null && error) return error(err);