mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-22 15:42:31 +02:00
fix: unnecessary emails are sent when a user signs a document via a shared link.
This commit is contained in:
@@ -19,6 +19,7 @@ function GuestLogin() {
|
||||
const [appLogo, setAppLogo] = useState("");
|
||||
const [documentId, setDocumentId] = useState(id);
|
||||
const [contactId, setContactId] = useState(contactBookId);
|
||||
const [sendmail, setSendmail] = useState();
|
||||
useEffect(() => {
|
||||
handleServerUrl();
|
||||
|
||||
@@ -54,6 +55,7 @@ function GuestLogin() {
|
||||
setDocumentId(checkSplit[0]);
|
||||
setEmail(checkSplit[1]);
|
||||
setContactId(checkSplit[2]);
|
||||
setSendmail(checkSplit[3]);
|
||||
}
|
||||
|
||||
setIsLoading(false);
|
||||
@@ -146,7 +148,13 @@ function GuestLogin() {
|
||||
//save isGuestSigner true in local to handle login flow header in mobile view
|
||||
localStorage.setItem("isGuestSigner", true);
|
||||
setLoading(false);
|
||||
navigate(`/load/recipientSignPdf/${documentId}/${contactId}`);
|
||||
if (sendmail === "false") {
|
||||
navigate(
|
||||
`/load/recipientSignPdf/${documentId}/${contactId}?sendmail=${sendmail}`
|
||||
);
|
||||
} else {
|
||||
navigate(`/load/recipientSignPdf/${documentId}/${contactId}`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("err ", error);
|
||||
|
||||
@@ -39,11 +39,16 @@ import Title from "../components/Title";
|
||||
import DefaultSignature from "../components/pdf/DefaultSignature";
|
||||
import ModalUi from "../primitives/ModalUi";
|
||||
import VerifyEmail from "../components/pdf/VerifyEmail";
|
||||
function useQuery() {
|
||||
return new URLSearchParams(useLocation().search);
|
||||
}
|
||||
|
||||
function PdfRequestFiles() {
|
||||
const { docId } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
const query = useQuery();
|
||||
const sendmail = query.get("sendmail");
|
||||
const [pdfDetails, setPdfDetails] = useState([]);
|
||||
const [signedSigners, setSignedSigners] = useState([]);
|
||||
const [unsignedSigners, setUnSignedSigners] = useState([]);
|
||||
@@ -730,7 +735,7 @@ function PdfRequestFiles() {
|
||||
);
|
||||
const newIndex = index + 1;
|
||||
const user = pdfDetails?.[0].Signers[newIndex];
|
||||
if (sendInOrder) {
|
||||
if (sendmail !== "false" && sendInOrder) {
|
||||
const requestBody = pdfDetails?.[0]?.RequestBody;
|
||||
const requestSubject = pdfDetails?.[0]?.RequestSubject;
|
||||
if (user) {
|
||||
|
||||
@@ -998,9 +998,10 @@ function PlaceHolderSign() {
|
||||
for (let i = 0; i < signerMail.length; i++) {
|
||||
const objectId = signerMail[i].objectId;
|
||||
const hostUrl = window.location.origin;
|
||||
const sendMail = false;
|
||||
//encode this url value `${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}` to base64 using `btoa` function
|
||||
const encodeBase64 = btoa(
|
||||
`${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}`
|
||||
`${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}/${sendMail}`
|
||||
);
|
||||
let signPdf = `${hostUrl}/login/${encodeBase64}`;
|
||||
shareLinkList.push({ signerEmail: signerMail[i].Email, url: signPdf });
|
||||
|
||||
Reference in New Issue
Block a user