Skip to content

Commit

Permalink
chore: Update mail.js configuration for secure connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Mipronimo committed Jun 7, 2024
1 parent 80f3ad9 commit edd7542
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/config/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export default {
from: process.env.SMTP_FROM || "[email protected]",
pass: process.env.SMTP_PASS || "password",
bcc: process.env.SMTP_BLINDCOPY || "",
secure: process.env.SMTP_SECURE || false,
},
booking: {
host: process.env.SMTP_BOOKING_HOST || process.env.SMTP_HOST || "smtp.example.com",
port: process.env.SMTP_BOOKING_PORT || process.env.SMTP_PORT || 587,
user: process.env.SMTP_BOOKING_USER || process.env.SMTP_USER || "username",
from: process.env.SMTP_BOOKING_FROM || process.env.SMTP_FROM || "[email protected]",
pass: process.env.SMTP_BOOKING_PASS || process.env.SMTP_PASS || "password"
pass: process.env.SMTP_BOOKING_PASS || process.env.SMTP_PASS || "password",
secure: process.env.SMTP_BOOKING_SECURE || process.env.SMTP_SECURE || false,
}
};
4 changes: 2 additions & 2 deletions src/controllers/mail.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export async function sendMailToParents(orderId, positionId, type) {
const transporter = nodemailer.createTransport({
host: mail.booking.host,
port: mail.booking.port,
secure: false,
secure: mail.booking.secure,
auth: {
user: mail.booking.user,
pass: mail.booking.pass
Expand Down Expand Up @@ -231,7 +231,7 @@ export async function sendMailToUser(uuid, type) {
const transporter = nodemailer.createTransport({
host: mail.default.host,
port: mail.default.port,
secure: false,
secure: mail.default.secure,
auth: {
user: mail.default.user,
pass: mail.default.pass
Expand Down

0 comments on commit edd7542

Please sign in to comment.