Updated the email.ts util
This commit is contained in:
parent
848327b922
commit
c1d6b736ef
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user