SOLVED

Re: Bundling Products in emails and Alerts

Go to solution
Luis_Esquivel1
Level 2

Bundling Products in emails and Alerts

Hi fellow Marketers,

The objective is to send emails and alerts triggered by consumer interaction on our website. In an effort to avoid sending multiple emails and alerts to and about the same consumer, but providing a complete picture, we would like to bundle all of the interactions within a certain time frame and send them in a single email and alert.

Current Drafted  solution-

  • Creating multiple fields (one per product for urls) and a smart campaign to write pages interacted with to those fields using the {{trigger.Web Page}} token.
  • Setting up a Smart Campaign triggered by the interaction where the first action is a wait step
  • After the wait, sending an email that leverages email scripting to determine if the product fields are populated and loading certain content per case.
  • Sending an alert to a rep with a list of products (same Email Scripting) and using tokens for the new fields to load the urls with the interactions
  • Wiping the URLs in the new product fields on a set cadence

Before I go create new fields for each product willy nilly, I'd like to bounce the idea around and get input to make sure I have the optimal solution.

Thoughts?

Thanks in advance!

Benjamin MurrayEbony VentersCaycia Banks

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Bundling Products in emails and Alerts

I def'ly approve of the idea of consolidating actions, and since you have a classic Dead Man's Switch problem, the wait step is the best workaround.

My specific suggestion would be to store the interaction history in JSON array fragment, which can be parsed in Velocity. I say "fragment" instead of "field" because you can't actually enclose the outer array with brackets, since flows doesn't speak JSON. Instead, append objects to the array:

     { "page" : "{{trigger.web page]}", "ts" : "{{system.datetime}}" }, {{lead.interaction history}}

Then in Velocity wrap it in square brackets [] before turning it into a live ArrayList. From there you can do anything with the data.

View solution in original post

9 REPLIES 9
Josh_Hill13
Level 10 - Champion Alumni

Re: Bundling Products in emails and Alerts

Not sure you'd know if this was optimal until you tried it. I suppose it could work. Have you considered Custom Objects?

Have you done any smart lists to determine a possible Wait time? Or even how many people it could affect periodically?

Luis_Esquivel1
Level 2

Re: Bundling Products in emails and Alerts

Theoretically optimal might be a better description. By that I mean something along the lines of having the smallest footprint (field creation, smart campaigns/processes) and low maintenance effort.

I haven't considered Custom Objects yet.

Yes, we have an idea of the consumer behavior on our website via several smart lists and will settle on a duration.

SanfordWhiteman
Level 10 - Community Moderator

Re: Bundling Products in emails and Alerts

I haven't considered Custom Objects yet.

Don't.

COs are entirely unsuitable for this project due to volume alone.

SanfordWhiteman
Level 10 - Community Moderator

Re: Bundling Products in emails and Alerts

I def'ly approve of the idea of consolidating actions, and since you have a classic Dead Man's Switch problem, the wait step is the best workaround.

My specific suggestion would be to store the interaction history in JSON array fragment, which can be parsed in Velocity. I say "fragment" instead of "field" because you can't actually enclose the outer array with brackets, since flows doesn't speak JSON. Instead, append objects to the array:

     { "page" : "{{trigger.web page]}", "ts" : "{{system.datetime}}" }, {{lead.interaction history}}

Then in Velocity wrap it in square brackets [] before turning it into a live ArrayList. From there you can do anything with the data.

Luis_Esquivel1
Level 2

Re: Bundling Products in emails and Alerts

This is an awesome alternative. I've parsed JSON with JS before, but I've only used very basic Velocity. I will definitely draft this up, but it will require some research on my end. Might you have any documentation around this handy?

Thanks for the input!

SanfordWhiteman
Level 10 - Community Moderator

Re: Bundling Products in emails and Alerts

Luis_Esquivel1
Level 2

Re: Bundling Products in emails and Alerts

This is great stuff- really leveraging velocity and the capabilities of a single field. Drafting a solution in our sandbox for proposal. Thanks!

Luis_Esquivel1
Level 2

Re: Bundling Products in emails and Alerts

How would one wrap the ${activityField} in brackets? I can manipulate the JSON at will when I set it manually, but I can't seem to throw brackets on it without running into a variety of errors.

SanfordWhiteman
Level 10 - Community Moderator

Re: Bundling Products in emails and Alerts

If you have an "open-ended" list/JSON array (i.e. without the square brackets, like so):

{"page":"http://www.example.com/url1"}, {"page":"http://www.example.com/url2"}

Then turn it into a live ArrayList with this VTL:

#set( $urlHistory = '#set( $urlHistory = [' + $lead.urlHistoryOpenArray + '] )' )

#evaluate( $urlHistory )