Solution for changing tokened account owner email address

Megan_Rublee
Level 2

Solution for changing tokened account owner email address

Hi all! My company has a welcome email that is generated after a lead's first deal is funded. In the email, there is a lead token used to pull in the account owner's email address. The data cleanliness at my company is not great and we have some customers in our database who's account owner is under a generic name, such as "Service Account." When a customer who is owner by Service Account receives this Welcome email, the sentence will read something like "You'll be hearing from me (your account manager). Please reach out at any time with questions or additional needs by emailing serviceaccount@mycompany.com." I would like to prevent new customers from having this type of experience. Any ideas on how I can make this a better experience and prevent customers from receiving emails from Service Account rather than a person?

Thank you!

-Megan 

Tags (1)
2 REPLIES 2
Michael_Florin
Level 10

Re: Solution for changing tokened account owner email address

Hi Megan,

I'd say this depends on what you mean by "prevent customers from receiving emails from Service Account". If you don't want to send them any email at all if their account is owned by Service Account, you can just exclude them for your send.

If you want to send them something different, you might want to create a different email in a non-personalized version and send that email through a Flow Step constraint, like if "Account Owner = Service Account".

What I would probably do though is bring in a Script Token, instead of that Lead Token. In that script you can select the from-email-address based on the value in Account Owner. 

 

That would look something like this:

## if Service Account, display generic email address
#if(${lead.Account Owner} == "Service Account")
megan.rublee@acme.com
#else
${lead.Owner Email}
#end

(The field names for Account Owner and Owner Email were just made up by me. They would need to match the respective names in your database)

SanfordWhiteman
Level 10 - Community Moderator

Re: Solution for changing tokened account owner email address

You'd see the real property name when dragging the field onto the canvas in Script Editor -- and Marketo ensures that field names exported into Velocity don't have spaces.

But spaces are allowed in property names. If it did have spaces, you couldn't use dot notation: $lead.property with space is a fatal error and you'd have to use bracket notation $lead["property with space"].

## if Service Account, display generic email address
#if( $lead.AccountOwner.equals("Service Account") )
megan.rublee@acme.com##
#else
${lead.OwnerEmail}##
#end‍‍‍‍‍‍

(I also commented out the trailing whitespace, even if it's technically allowed at the end of the header per RFC 5322 we don't want to give Marketo any extra challenges....)