Hi Team,
I have a smart campaign built on custom object fields, and the custom object is tied at the account level. As a result, whenever a lead is closed, the record syncs to all contacts in Marketo, which causes the email to trigger for every contact with a unique email address. I’m trying to find a way to prevent this behavior.
One option is to pass a flag from CRM to Marketo to identify the specific contact associated with the lead so the others dont get an email (as content is really specific to the contact our sales team had a discussion). However, I wanted to check if there’s another way to handle this without adding an extra CRM field.
Is there a way to match the custom object field (on the left) with a lead level token (on the right.. could be {{lead.contact}} ) so that it only qualifies the contact id related to that lead? Also open to any other possible approaches—looking forward to your guidance.
Please let me know if you need anything else.
Regards,
Akshat
@SanfordWhiteman Thanks for your feedback on this one .
Can you please guide me with the Velocity script or share an example that I can use for testing?
Also, if possible, could you show how the filter would look once the Velocity condition is added? i think the velocity token needs to be added into the email right to abort the send if they dont match?
Regards,
Akshat
Like so:
#set( $sortedList = $sorter.sort($SomeObject_cList,"updatedAt:desc") )
#set( $focusedObject = $sortedList[0] )
#if( !$focusedObject.someField.equals($lead.someRelatedField) )
#throw( "ObjectRelationshipError" )
#end
Where the #throw Velocimacro is defined:
#macro( throw $message )
#if( !$message.isEmpty() )
#evaluate( "${esc.h}set( ${message} )" )
#end
#end