fix(contact): import env instead of undefined config
Some checks failed
Build & Deploy / 🔍 Prepare (push) Failing after 27s
Build & Deploy / 🧪 QA (push) Has started running
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Failing after 27s
Build & Deploy / 🧪 QA (push) Has started running
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,7 @@ import { sendEmail } from '@/lib/mail/mailer';
|
|||||||
import { render, ContactFormNotification, ConfirmationMessage } from '@mintel/mail';
|
import { render, ContactFormNotification, ConfirmationMessage } from '@mintel/mail';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { getServerAppServices } from '@/lib/services/create-services.server';
|
import { getServerAppServices } from '@/lib/services/create-services.server';
|
||||||
|
import { env } from '@/lib/env';
|
||||||
|
|
||||||
export async function sendContactFormAction(formData: FormData) {
|
export async function sendContactFormAction(formData: FormData) {
|
||||||
const services = getServerAppServices();
|
const services = getServerAppServices();
|
||||||
@@ -95,7 +96,7 @@ export async function sendContactFormAction(formData: FormData) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!isTestSubmission) {
|
if (!isTestSubmission) {
|
||||||
logger.info('Sending internal notification', { recipients: config.mail.recipients });
|
logger.info('Sending internal notification', { recipients: env.MAIL_RECIPIENTS });
|
||||||
const notificationResult = await sendEmail({
|
const notificationResult = await sendEmail({
|
||||||
replyTo: email,
|
replyTo: email,
|
||||||
subject: notificationSubject,
|
subject: notificationSubject,
|
||||||
@@ -110,14 +111,14 @@ export async function sendContactFormAction(formData: FormData) {
|
|||||||
logger.error('Notification email DELIVERY FAILED', {
|
logger.error('Notification email DELIVERY FAILED', {
|
||||||
error: notificationResult.error,
|
error: notificationResult.error,
|
||||||
subject: notificationSubject,
|
subject: notificationSubject,
|
||||||
recipients: config.mail.recipients,
|
recipients: env.MAIL_RECIPIENTS,
|
||||||
});
|
});
|
||||||
services.errors.captureException(
|
services.errors.captureException(
|
||||||
new Error(`Notification email failed: ${notificationResult.error}`),
|
new Error(`Notification email failed: ${notificationResult.error}`),
|
||||||
{
|
{
|
||||||
action: 'sendContactFormAction_notification',
|
action: 'sendContactFormAction_notification',
|
||||||
email,
|
email,
|
||||||
recipients: config.mail.recipients
|
recipients: env.MAIL_RECIPIENTS
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preinstall": "npx only-allow pnpm"
|
"preinstall": "npx only-allow pnpm"
|
||||||
},
|
},
|
||||||
"version": "2.3.13",
|
"version": "2.3.14",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@parcel/watcher",
|
"@parcel/watcher",
|
||||||
|
|||||||
Reference in New Issue
Block a user