SOLVED

Dynamic address for email

Go to solution
Anonymous
Not applicable

Dynamic address for email

Hi,

We send out emails with dynamic content which is segmented by 5 languages.

I need an address in the email to also be dynamic (based on the location of the sales team) and this has no relationship to the 5 language segments used.

What would be the best way to go about this?

Thanks in advance for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic address for email

If there's no applicable segmentation, nor any new segmentation that could be created to fill this need, then you have two basic choices:

  1. Persist the address as a custom field on every lead (not recommended)
  2. Velocity (email scripting, highly recommended)

Velocity basically picks up where segmentations leave off, and while it requires development skills, it is vastly more powerful than segs alone.

You might check my Velocity-related replies here and on the posts on my blog: http://blog.teknkl.com/tag/velocity.

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic address for email

If there's no applicable segmentation, nor any new segmentation that could be created to fill this need, then you have two basic choices:

  1. Persist the address as a custom field on every lead (not recommended)
  2. Velocity (email scripting, highly recommended)

Velocity basically picks up where segmentations leave off, and while it requires development skills, it is vastly more powerful than segs alone.

You might check my Velocity-related replies here and on the posts on my blog: http://blog.teknkl.com/tag/velocity.

View solution in original post

Anonymous
Not applicable

Re: Dynamic address for email

Thanks for the help, Sanford.

I believe that velocity is definitely the way to go!

This is how I've scripted the token, but I am unsure how to incorporate the html for address A and address B within the token to account for line breaks etc.  

pastedImage_4.png

Thanks in advance for the input!

Anonymous
Not applicable

Re: Dynamic address for email

Never mind! I didn't realize I could just copy the html straight into the token's script!

This is amazing thank you

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic address for email

pastedImage_4.png

Actually this code isn't doing what you think it is...

  #if( $variable == "string1" || "string2" || "string3" )

will only be true if $variable == "string1". I think you're thinking of syntax from other languages (like the coalescing || in JavaScript). In Velocity, this is going to perform the first comparison, then check to see if the string literals "string2" and "string3" are truthy. String literals are never truthy, though.

Use something like this instead:

#set( $salesTeamsAddressA = ["JH","JRP","LJ"] )

#if( $salesTeamsAddressA.contains($lead.Sales_Team__c) )

Address A

#else

Address B

#end

Tom Kerlin

Tom_Kerlin2
Level 7

Re: Dynamic address for email

Hi Sanford,

I'm not sure if you meant to mention me here.

-Tom

Tom Kerlin
SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic address for email

Thanks, I meant Thomas Merlin

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic address for email

Also, please move your question to Products​. "Community" here refers to the Marketo Nation website itself -- and yes, this is confusing.