3 Replies Latest reply on May 25, 2017 12:39 AM by Sanford Whiteman

    Velocity scripting and pulling in lead. tokens

    Katie Abbott

      Hey there,

      This is my first try at Velocity scripting so don't laugh if I've made a simple error but just can't see it.

       

      Ok so the situation is that we will have a 'faux booking' form on a website. The lead can select how many passengers there will be, up to 6. And enters their details

      Depending on what value they put in for 'how many passengers do you have?', different text shows in an alert email to a sales consultant. If they select 3 adults, then the details of those 3 passengers will show in the alert email. If 6, then 6.

       

      This is what I would like to appear: (note: passenger 1 is the actual lead's record, so not included in the scripting)

       

      Passenger 2

      Name: Bob Smith

      Date of Birth: 25/02/1990

       

      Passenger 3

      Name: Kelly Jones

      Date of Birth: 01/08/1965

       

      Passenger 4

      Name: Mark Jones

      Date of Birth: 30/09/1970

       

      Passenger 5

      Name: Terry Adams

      Date of Birth: 22/04/1980

       

      Passenger 6

      Name: Mark Adams

      Date of Birth: 14/08/1996

       

      However, this is what is appearing when I do a real (and sample) send:

       

      Passenger 2

      Name: Bob Smith

      Date of Birth: 25/02/1990

       

      Passenger 3

      Name: ${lead.mktoFirstname2} ${lead.mktoLastname2}

      Date of Birth: ${lead.mktoDOB2}

       

      Passenger 4

      Name: ${lead.mktoFirstname3} ${lead.mktoLastname3}

      Date of Birth: ${lead.mktoDOB3}

       

      Passenger 5

      Name: ${lead.mktoFirstname4} ${lead.mktoLastname4}

      Date of Birth: ${lead.mktoDOB4}

       

      Passenger 6

      Name: ${lead.mktoFirstname5} ${lead.mktoLastname5}

      Date of Birth: ${lead.mktoDOB5}

       

       

      Here is the email script for if the Passengers=6

       

      #if(${lead.mktoPassengers1}==6)

      Passenger 2 <br/>

      Name: ${lead.mktoFirstname1} ${lead.mktoLastname1} <br/>

      Date of Birth: ${lead.mktoDOB1} <br/>

      <br/>

      Passenger 3 <br/>

      Name: ${lead.mktoFirstname2} ${lead.mktoLastname2} <br/>

      Date of Birth: ${lead.mktoDOB2} <br/>

      <br/>

      Passenger 4 <br/>

      Name: ${lead.mktoFirstname3} ${lead.mktoLastname3} <br/>

      Date of Birth: ${lead.mktoDOB3} <br/>

      <br/>

      Passenger 5 <br/>

      Name: ${lead.mktoFirstname4} ${lead.mktoLastname4} <br/>

      Date of Birth: ${lead.mktoDOB4} <br/>

      <br/>

      Passenger 6 <br/>

      Name: ${lead.mktoFirstname5} ${lead.mktoLastname5} <br/>

      Date of Birth: ${lead.mktoDOB5} <br/>

      #end

       

       

      Can anyone help me? Any explanations/ suggestions as to why aren't the lead. tokens pulling in the data would be AWESOME!

      I have double checked and the fields are named correctly and the test lead I'm using has data in the fields.

       

      Thanks!

      Katie