5 Replies Latest reply on Feb 5, 2015 9:20 AM by 80558

    Using the triggerobject reference in a velocity script

      Hi all,

      I am trying to use the TriggerObject reference to use trigger objects fields in an emai, as stated on developers.marketo.com and I cannot figure out how this is suposed to work.

      I have a custom object (Demande__c) linked to the lead. When a new Demande__c in inserted, I want to send out an email with some fields of this instance of the object. I use the "Added to Demande" trigger to trigger a campaign that send this email.

      The tricking thing is that the lead can have many instances of the object Demande__c and what I need is to get precisely the one that triggered the campaign. For this, I have used the TriggerObject reference. My script is :

      <table>
      <tr><td>Last Name : </td><td>${lead.LastName}</td></tr>
      <tr><td>Type de demande : </td><td>${TriggerObject.Type_de_demande__c}</td></tr>
      <tr><td>Date/heure de la demande : </td><td>${TriggerObject.Date_Heure_de_la_demande__c}</td></tr>
      </table>
      If I check the Type_de_demande and Date_Heure_de_la_demande__c in the script editor right column, I get an error. If I don't I get the email with the variable names still in it.

      Can anyone help?

      On a more global point of view, having various and comprehensive code samples on the developers site would be welcome...

      Thanks in advance,
      Greg