1 Reply Latest reply on Jul 13, 2017 2:01 AM by Sanford Whiteman

    Restrict access to a landing page info

    Charles THIERY



      I'm not an expert of Javascript coding and I would be grateful if somebody can help me to complete my script coding.


      Basically, I want that a lead clicking on a email link generated with a lead.token reaches the landing page and the JS checks against his current lead.token value (if it's equal) to show the right section.


      My email will generate an email link http://www.example.com?approved={{lead.versionning}}    (here lead.versionning is a number).


      I have 2 section in the html called "approved" and "rejected" that I want to have display depending the following test.


      <script src="//code.jquery.com/jquery-1.12.0.min.js"></script>

      <script type="text/javascript">

      // Parse the URL parameter

      function getParameterByName(name, url) {

         if (!url) url = window.location.href;

         name = name.replace(/[\[\]]/g, "\\$&");

         var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),

             results = regex.exec(url);

         if (!results) return null;

         if (!results[2]) return '';

         return decodeURIComponent(results[2].replace(/\+/g, " "));


      // Give the parameter a variable name and convert to Number for making comparison

      var dynamicContent = Number (getParameterByName('approved'));

      var versionning = Number ({{lead.versionning}});


      // Display the righ section according the test of versionning   

      $(document).ready(function() {

      // Check if the URL parameter is apples

      if (dynamicContent == versionning) {


      }  else {





      I don't know if what I put in bold would work because not sure how to pass to lead.token within JS.


      Sandford Whiteman, you are the one who help me before, hope you can help me again.


      Best Regards,