This commit is contained in:
@@ -2,14 +2,15 @@ import nodemailer from "nodemailer";
|
||||
import { render } from "@react-email/components";
|
||||
import { ReactElement } from "react";
|
||||
import { getServerAppServices } from "@/lib/services/create-services.server";
|
||||
import { config } from "../config";
|
||||
|
||||
const transporter = nodemailer.createTransport({
|
||||
host: process.env.MAIL_HOST,
|
||||
port: Number(process.env.MAIL_PORT),
|
||||
secure: Number(process.env.MAIL_PORT) === 465,
|
||||
host: config.mail.host,
|
||||
port: config.mail.port,
|
||||
secure: config.mail.port === 465,
|
||||
auth: {
|
||||
user: process.env.MAIL_USERNAME,
|
||||
pass: process.env.MAIL_PASSWORD,
|
||||
user: config.mail.user,
|
||||
pass: config.mail.pass,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -22,10 +23,10 @@ interface SendEmailOptions {
|
||||
export async function sendEmail({ to, subject, template }: SendEmailOptions) {
|
||||
const html = await render(template);
|
||||
|
||||
const recipients = to || process.env.MAIL_RECIPIENTS?.split(",") || [];
|
||||
const recipients = to || config.mail.recipients;
|
||||
|
||||
const mailOptions = {
|
||||
from: process.env.MAIL_FROM,
|
||||
from: config.mail.from,
|
||||
to: recipients,
|
||||
subject,
|
||||
html,
|
||||
|
||||
Reference in New Issue
Block a user