mailclient settings from config

This commit is contained in:
Dobromir Popov
2024-04-07 00:29:38 +03:00
parent 1e2c69767f
commit ce3e5c84bd
3 changed files with 18 additions and 10 deletions

View File

@ -12,11 +12,13 @@ const Handlebars = require('handlebars');
// const OAuth2 = google.auth.OAuth2;
const { Shift, Publisher, PrismaClient } = require("@prisma/client");
const { env } = require("../../next.config");
// const TOKEN = process.env.TOKEN || "a7d7147a530235029d74a4c2f228e6ad";
// const SENDER_EMAIL = "sofia@mwitnessing.com";
// const sender = { name: "Специално Свидетелстване София", email: SENDER_EMAIL };
// const client = new MailtrapClient({ token: TOKEN });
const TOKEN = process.env.TOKEN || "a7d7147a530235029d74a4c2f228e6ad";
const SENDER_EMAIL = "sofia@mwitnessing.com";
const sender = { name: "Специално Свидетелстване София", email: SENDER_EMAIL };
const client = new MailtrapClient({ token: TOKEN });
let mailtrapTestClient = null;
// const mailtrapTestClient = new MailtrapClient({
// username: '8ec69527ff2104',//not working now
@ -25,11 +27,11 @@ let mailtrapTestClient = null;
//test
var transporter = nodemailer.createTransport({
host: "sandbox.smtp.mailtrap.io",
host: process.env.MAILTRAP_HOST || "sandbox.smtp.mailtrap.io",
port: 2525,
auth: {
user: "8ec69527ff2104",
pass: "c7bc05f171c96c"
user: process.env.MAILTRAP_USER,
pass: process.env.MAILTRAP_PASS
}
});
// production