Skip to content

Commit

Permalink
fix: Passing SMTP configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
areknawo committed Sep 30, 2023
1 parent d0f0d29 commit 932ece3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/backend/src/plugins/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ const createEmailSender = (fastify: FastifyInstance): EmailSender => {

if (fastify.hostConfig.smtp) {
const transporter = nodemailer.createTransport({
host: fastify.config.SMTP_HOST || "",
port: fastify.config.SMTP_PORT || 465,
secure: fastify.config.SMTP_SECURE || true,
host: fastify.config.SMTP_HOST!,
port: fastify.config.SMTP_PORT!,
secure: Boolean(fastify.config.SMTP_SECURE),
...(fastify.config.SMTP_USERNAME &&
fastify.config.SMTP_PASSWORD && {
auth: {
user: fastify.config.SMTP_USERNAME || "",
pass: fastify.config.SMTP_PASSWORD || ""
user: fastify.config.SMTP_USERNAME,
pass: fastify.config.SMTP_PASSWORD
}
})
});
Expand Down

0 comments on commit 932ece3

Please sign in to comment.