SOLVED

How can I send 1 email with dynamic content blocks for products they have and products they don't have?

Go to solution
Ronn_Burner
Level 4

How can I send 1 email with dynamic content blocks for products they have and products they don't have?

Here is what I'm being told from above that I need to solve for. I can't figure this out.

Think of our product model as DirecTV. A customer can go online and select (subscribe) to any channel or combination of channels they choose. - - So I have 10 ala carte products and a new subscriber signs up to any 1 single product or any number combination up to all 10 products. I only want ONE email to be sent per new subscriber regardless of how many products they subscribed to at one time. Then I will send a 2nd email later. Is it possible - and practical - to acknowledge each product they subscribed to uniquely with a text block and/or image for each AND a different text block promoting the products they did not subscribe to? And if not, what is the best way to handle this type of situation?

So many questions: 1. Segmentation logic? 2. Snippets, dynamic emails or unique streams or programs? 3. Engagement or Default Programs? 4. How to ensure ONLY 1 email regardless of new subscriptions deploys? 5. Smart campaign total and goal?

Any thoughts and or advice on how to handle this initial entry via new subscribers would be a life saver. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

- I should only use $lead.DMSSubscribed or $lead.DMSSubscribedDate and not both, right?

Only the DateTime field.

- Do I simply just replace all $lead.DMSSubscribed with $lead.DMSSubscribedDate in the code?

Yes, that is, if you're going to convert a stringified DateTime (i.e., ISO8601 format) field into a Date, that's where you use the DateTime.

However I don't think these are ISO8601 "yyyy-MM-dd'T'HH:mm:ss".  They're actually ISO8601 "yyyy-MM-dd HH:mm:ss". That is, they have a space instead of the letter "T". So you can add this line to the code at the top:

#set( $ISO8601WithSpace = "yyyy-MM-dd HH:mm:ss" )

Then use $ISO8601WithSpace where you're using $ISO8601 now.

Parsing a String to a Date requires that you tell Velocity (actually Java) all the parts of the format.

- Do I uncheck the $lead.DMSSubscribed box in the Script Token?

For clarity, yes, but it's harmless to leave it checked as you won't be using it. Leaving it unchecked means it will always have the value null. That may be more or less confusing if you accidentally use it, I don't know.

View solution in original post

96 REPLIES 96
Ronn_Burner
Level 4

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

Jay Jiang

You have saved my life before so I always like to check in with you to set me straight.

Jay_Jiang
Level 10

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

As Sandford says, use a velocity script that dynamically adds blocks of text if respective checkbox is ticked.

To have the email sent once, I assume your sign up form triggers a Filled out Form or Person is pushed to Marketo trigger? Send the email in the flow of that smart campaign.

Ronn_Burner
Level 4

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

I responded to Sanford below and as you can see, sadly, I'm not going to be able to do this without a significant amount of help. I'm sure this is not a part of your job description and I'm aware it's asking a lot. I would certainly understand if either of you weren't interested in helping me.

Now knowing velocity is the answer this is no longer an issue. My trigger would be based on the Data Value Change of PRODUCT A SUBSCRIBED = TRUE and in the flow (or stream if this becomes Engagement Program) it would just send the 1 email.

SanfordWhiteman
Level 10 - Community Moderator

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

What is a product subscription stored as? An individual Boolean? An individual DateTime? An entry in a semicolon-delimited list?

Ronn_Burner
Level 4

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

Individual boolean custom field per product. I have a custom CRM so was previously required to make those fields to utilize in other Up-sell program and get away from "Added to" and "Has updated" custom object world.

SanfordWhiteman
Level 10 - Community Moderator

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

This isn't a case for segmentations, then. Too many permutations. (Even if you could precompute them, you don't have enough segments.)

The answer: Velocity. VTL can easily check the value of a Boolean. (Many of my blog posts are about working with Boolean/Boolean-like/once-Boolean values, since it's the most important datatype to understand when using #if!)

Ronn_Burner
Level 4

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

This is so disheartening. I read the blog posts you linked to and it's far too complex for me. I have no experience with velocity. It's so confusing and I'm afraid I'm just not intelligent enough to do this on my own. I need hand holding to do this level of work within Marketo. As you say, I'm sure this is easy and certainly easy for you but it's a foreign language to me. Is there a way to get me through this - here step by step or offline if that's less annoying?

Jay_Jiang
Level 10

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

Trust me, the looping nurture program you set up is far more complex than creating an email script.  Don't fear what is unfamiliar. And I apologise for seeming to trivialise it.

Maybe Sanford Whiteman‌ can give you a helping hand with the code!

SanfordWhiteman
Level 10 - Community Moderator

Re: How can I send 1 email with dynamic content blocks for products they have and products they don't have?

Agreed, Jay!

Admittedly, it can feel good when your area of expertise is intimidating to others -- then you know it's a real skill. On the other hand, nothing is impossible... it may have taken many hours to get to an advanced level, but surely someone else can do it given enough time + enthusiasm. (I have one official student now, we'll see how that goes!)

Having at least a passing knowledge of VTL -- that's "Velocity Template Language" by the way, the full name of the language but interchangeable w/"Velocity" -- is critical to getting (seemingly) run-of-the-mill tasks done in Marketo.  And, to be frank, it's great for your career (bringing Velocity into a place that never used it makes you a hero)

In this case, you're talking about a bunch of special Strings in Velocity (corresponding to Booleans in Field Management) that each have one of two values: "1" (true-like) or "" (false-like). And you want to choose output based on the value.

Let's say 2 of the fields, checked off in the fields tree in Script Editor, are $lead.product1 and $lead.product2.

A basic Velocity snippet to do content switching looks like this:

#if( $lead.product1.equals("1") )
You subscribed to Product 1.
#else
You did not subscribe to Product 1.
#end
#if( $lead.product2.equals("1") )
You subscribed to Product 2.
#else
You did not subscribe to Product 2.
#end

The output lines are text-only for readability, but can just as easily be HTML.

(Granted I would probably do this in a slightly slicker way myself, but this way is easiest to understand.)