|
|
|
|
@@ -4,6 +4,7 @@ import { sendEmail } from '@/lib/mail/mailer';
|
|
|
|
|
import { render, ContactFormNotification, ConfirmationMessage } from '@mintel/mail';
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { getServerAppServices } from '@/lib/services/create-services.server';
|
|
|
|
|
import { env } from '@/lib/env';
|
|
|
|
|
|
|
|
|
|
export async function sendContactFormAction(formData: FormData) {
|
|
|
|
|
const services = getServerAppServices();
|
|
|
|
|
@@ -95,7 +96,7 @@ export async function sendContactFormAction(formData: FormData) {
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (!isTestSubmission) {
|
|
|
|
|
logger.info('Sending internal notification', { recipients: config.mail.recipients });
|
|
|
|
|
logger.info('Sending internal notification', { recipients: env.MAIL_RECIPIENTS });
|
|
|
|
|
const notificationResult = await sendEmail({
|
|
|
|
|
replyTo: email,
|
|
|
|
|
subject: notificationSubject,
|
|
|
|
|
@@ -110,14 +111,14 @@ export async function sendContactFormAction(formData: FormData) {
|
|
|
|
|
logger.error('Notification email DELIVERY FAILED', {
|
|
|
|
|
error: notificationResult.error,
|
|
|
|
|
subject: notificationSubject,
|
|
|
|
|
recipients: config.mail.recipients,
|
|
|
|
|
recipients: env.MAIL_RECIPIENTS,
|
|
|
|
|
});
|
|
|
|
|
services.errors.captureException(
|
|
|
|
|
new Error(`Notification email failed: ${notificationResult.error}`),
|
|
|
|
|
{
|
|
|
|
|
action: 'sendContactFormAction_notification',
|
|
|
|
|
email,
|
|
|
|
|
recipients: config.mail.recipients
|
|
|
|
|
recipients: env.MAIL_RECIPIENTS
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|