feat: payload cms

This commit is contained in:
2026-02-26 01:32:22 +01:00
parent 1963a93123
commit 7d65237ee9
67 changed files with 3179 additions and 760 deletions

View File

@@ -33,6 +33,17 @@ interface SendEmailOptions {
export async function sendEmail({ to, replyTo, subject, html }: SendEmailOptions) {
const recipients = to || config.mail.recipients;
const logger = getServerAppServices().logger.child({ component: 'mailer' });
if (!recipients) {
logger.error('No email recipients configured (MAIL_RECIPIENTS is empty and no "to" provided)', { subject });
return { success: false as const, error: 'No recipients configured' };
}
if (!config.mail.from) {
logger.error('MAIL_FROM is not configured — cannot send email', { subject, recipients });
return { success: false as const, error: 'MAIL_FROM is not configured' };
}
const mailOptions = {
from: config.mail.from,
@@ -42,7 +53,6 @@ export async function sendEmail({ to, replyTo, subject, html }: SendEmailOptions
html,
};
const logger = getServerAppServices().logger.child({ component: 'mailer' });
try {
const info = await getTransporter().sendMail(mailOptions);