Marketing Community:
Do you know if I change the “Marketo Sync” Name in SFDC to be something else if it will Mess up the sync? We are doing a lot more personalisation for sign-offs in email’s and if a name/lead doesn’t have a lead owner it defaults to "marketo sync." Is there a work around here that's easy where I do not have to have magical developer powers??
Hey Allison, this is a great use case for velocity scripting. You can use the lead owner name if it isn't Marketo Sync, and if it is Marketo Sync you can have it add a different value.
Please move the thread to Products as it's Marketo-product-specific.
Like Dory said, Velocity is the way to go. Whether you consider this magical is up to you :
##----SET DEFAULT DISPLAY NAME----
#set( $defaultLeadOwnerFriendly = "Your Rep" )
##
##----SET SPECIFIC NAMES TO TREAT AS BLANK----
#set( $deFactoEmpty = [ "Marketo Sync", "Obsolete Owner" ] )
##
##----NO NEED TO EDIT BELOW THIS LINE!----
#set( $leadOwnerFriendly = "$!{lead.Lead_Owner_First_Name} $!{lead.Lead_Owner_Last_Name}" )
#set( $leadOwnerFriendly = $leadOwnerFriendly.trim() )
#if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains($leadOwnerFriendly) )
#set( $leadOwnerFriendly = $defaultLeadOwnerFriendly )
#end
${leadOwnerFriendly}
How do I move this to marketo products?
Also, where do I put the script code you wrote above?
There should be a "Move" link on the right nav bar when you edit the post.
Velocity ("Email Script") tokens are added, like the other {{my.token}} types like Text*, Rich Text/HTML, and Calendar tokens, at the Folder or Program level.
Then you reference them in your email by the token name: {{my.leadOwnerDetector}} for example.
* A Velocity token without any special code and just the one line "hello" is basically identical to the Text token "hello." It's with the addition of #set and #if conditions that Velo comes alive.
Sanford,
I have tried this code in the email script token:
#set( $defaultLeadOwnerFriendly = "The Team at eOriginal" )
#set( $deFactoEmpty = [ "Marketo Sync" ] )
#set( $leadOwnerFriendly = "$!{lead.Lead_Owner_First_Name} $!{lead.Lead_Owner_Last_Name}" )
#if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains("Marketo Sync") )
#set( $leadOwnerFriendly = $defaultLeadOwnerFriendly )
#end
${leadOwnerFriendly}
It is only returning the default "The Team at eOriginal"
even when the lead owner isn't empty and defacto empty is marketo. What am I doing wrong here? I've tested in a test smart campaign to myself as a lead with a sales rep as the owner, so the lead owner would not have been empty or marketo sync, can you please help?
<- where my script is, and token name
Hi Alison,
Sanford's line below is faulty (it's so rare that I can correct Sanford's code, that I am jumping on the occasion )
#if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains("Marketo Sync") )
should be
#if( $leadOwnerFriendly.isEmpty() || $leadOwnerFriendly.contains("Marketo Sync") )
or even better, since you are setting the defactoempty:
#if( $leadOwnerFriendly.isEmpty() || $leadOwnerFriendly.contains($deFactoEmpty) )
-Greg
Fixed the last line (wrong copy/paste) in my post.
-Greg
In fact, Sanford's code was not faulty (my bad), but the way you replaced "$deFactoEmpty.contains($leadOwnerFriendly))" with "$deFactoEmpty.contains("Marketo Sync"))" made it wrong as this is always true.
So, the line should be
#if( $leadOwnerFriendly.isEmpty() || $deFactoEmpty.contains($leadOwnerFriendly) )
Sorry Sanford for doubting of you
-Greg
Ha, I was about to issue a defense.
Yep, Allison, see where it says NO NEED TO EDIT BELOW THIS LINE? You edited below that line.
$deFactoEmpty is an array of all owner values that should be interpreted as empty (obselete values, placeholders, etc.). Those values, as well as true empty values, are replaced by whatever you set as $defaultLeadValueFriendly.