fix(security): use server-configured PET notification recipient
This commit is contained in:
+3
-17
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user