Hi all - I'm looking to strip the email domain from a record's email address as a placeholder for Company Name. I figure I can do this with an email script token, but I'm having some trouble finding any examples to work off of. Any ideas?
Solved! Go to Solution.
Josh doesn't like Velocity today.
#set( $domainMatcher = $lead.Email.split("^.*@") )
#if( !$lead.Company.isEmpty() )
Real Company field: ${lead.Company}
#elseif( $domainMatcher.size() > 1 )
Synthetic Company from Email: $domainMatcher[1]
#else
No Company available.
#end
This'll get you what you're describing -- just realize that if someone uses a personal email address their employer isn't "gmail.com."
at the form fill level or when you send an email with a token?
Form Fill=use jquery
Token Rendering = use a process outside of marketo to parse this when Company IS EMPTY.
Josh doesn't like Velocity today.
#set( $domainMatcher = $lead.Email.split("^.*@") )
#if( !$lead.Company.isEmpty() )
Real Company field: ${lead.Company}
#elseif( $domainMatcher.size() > 1 )
Synthetic Company from Email: $domainMatcher[1]
#else
No Company available.
#end
This'll get you what you're describing -- just realize that if someone uses a personal email address their employer isn't "gmail.com."