added in message queue for applications and reps
This commit is contained in:
@@ -1,19 +1,11 @@
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import { Field, reduxForm } from "redux-form";
|
||||
import {
|
||||
RenderPickList,
|
||||
RenderTextfield,
|
||||
RenderRadioList,
|
||||
RenderMultiline,
|
||||
} from "./representationElements";
|
||||
import {
|
||||
setRepresentationCapacity,
|
||||
setRepresentationSubmit,
|
||||
setSubmitBack,
|
||||
} from "../../../store/currentView/action";
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import { sendEmail, sendRepCompleteMessage } from "../../../actions";
|
||||
import { setRepresentationReset } from "../../../store/currentView/action";
|
||||
|
||||
const RepComplete = (props) => {
|
||||
let { t } = useTranslation();
|
||||
@@ -28,6 +20,7 @@ const RepComplete = (props) => {
|
||||
currentView,
|
||||
setSubmitBack,
|
||||
setRepresentationSubmitConfirmation,
|
||||
setRepresentationMessageSent,
|
||||
} = props;
|
||||
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
||||
const files = acceptedFiles.map((file) => (
|
||||
@@ -36,6 +29,28 @@ const RepComplete = (props) => {
|
||||
</li>
|
||||
));
|
||||
|
||||
useEffect(() => {
|
||||
const reference = "PEDW-REPRESENTATION-COMPLETE";
|
||||
const templateId = "c49785e7-3217-40b6-b33f-dffc4e58d5c1";
|
||||
const emailAddress =
|
||||
props.props.props.props.accountDetails.accountDetails.emailaddress1;
|
||||
const personalisation = {
|
||||
"caseReference":
|
||||
props.props.currentView.caseReference.currentReference,
|
||||
"emailAddress":
|
||||
props.props.props.props.accountDetails.accountDetails
|
||||
.emailaddress1,
|
||||
"linkExpiry": 10 * 60,
|
||||
};
|
||||
|
||||
props.props.currentView.representationMessageSent != true &&
|
||||
(sendRepCompleteMessage(
|
||||
props.props.props.props.accountDetails.containerID,
|
||||
props.props.currentView.caseReference.currentReference
|
||||
),
|
||||
sendEmail(templateId, emailAddress, personalisation, reference),
|
||||
setRepresentationMessageSent(true));
|
||||
});
|
||||
return (
|
||||
<div id="rep-appellant">
|
||||
<div className="govuk-grid-column-full">
|
||||
@@ -64,7 +79,12 @@ const RepComplete = (props) => {
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-button-group">
|
||||
<Link href="/myportal">
|
||||
<a className="govuk-button">Continue</a>
|
||||
<a
|
||||
onClick={() => setRepresentationReset()}
|
||||
className="govuk-button"
|
||||
>
|
||||
Continue
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user