fix(security): use server-configured PET notification recipient

This commit is contained in:
2026-11-09 14:04:31 +00:00
parent f4f8075af3
commit ff84e9ea0f
6 changed files with 99 additions and 67 deletions
+3 -17
View File
@@ -21,7 +21,6 @@ import {
sendContactUsConfirmation,
sendContactUsPETNotification
} from "../actions/services/notifyDirectService";
import { wrapper } from "../store/store";
import { useState } from "react";
@@ -322,7 +321,7 @@ let ContactUs = (props) => {
sendContactEmail(formValues);
createCRMTask(formValues);
formValues.typeOfContact == "plq" &&
sendPETEmail(formValues, props.petEmail);
sendPETEmail(formValues);
console.log("Form submitted:", formValues);
};
@@ -350,11 +349,9 @@ let ContactUs = (props) => {
}
};
const sendPETEmail = async (formValues, petEmail) => {
console.log(petEmail);
const sendPETEmail = async (formValues) => {
try {
const res = await sendContactUsPETNotification(formValues, petEmail);
const res = await sendContactUsPETNotification(formValues);
console.log("Email sent successfully.");
setFormSubmitted(true);
@@ -519,17 +516,6 @@ const mapStateToProps = (state) => {
};
};
export const getServerSideProps = wrapper.getServerSideProps(
(store) => async (ctx) => {
const { req, locale } = ctx;
return {
props: {
petEmail: process.env.PETEMAIL
}
};
}
);
export default connect(
mapStateToProps,
mapDispatchToProps