So this issue has been resolved. I just updated all {{system.date}} flow steps in entire instance with {{system.dateTime}} so the times will all match in the daily CRM-Marketo sync.
Yes. But you should also wrap the first set of conditions in a not-equals check
This image is the snapshot of the transition from Product 8 to the not-equals check.
Sorry but I really can't sign off on your implementation
I understand that and I will certainly test once I at least "think" I have the script correct. For example, if this image is correct I can move in that direction, however, I'm not certain you meant to script it the way I have here or if you meant something else.
That's not valid VTL, it will throw a fatal error instantly as you'll see in Preview.
I'm saying you need to wrap the entire Calendar creation in an isEmpty() check. The #etc., etc. represents where you'd put your existing code. You're adding a precondition around it, also called a guard.
#if( !$lead.ProductXSubscribed.isEmpty() )
#set( $calProductXSubscribed = $convert.toCalendar(
$convert.parseDate(
$lead.ProductXSubscribed,
$ISO8601,
$defaultLocale,
$defaultTimeZone
)
) )
#if( $date.difference($calNow,$calProductXSubscribed).getHours() >= -24 )
You subscribed to Product X within the past 24 hours.
#end
#end
Got it. I think. This now has the first set of conditions wrapped per product for an isEmpty() check. Then following the Calendar creation and guard I then transition into the #if( $lead.ProductXSubscribed.equals("") ) check to send that appropriate messaging.
This image transition from Product 8 into still yet to Subscribes.
I believe that is now accurate and correct. But in my email test sends I don't see anything populating. Where exactly do I place the {{my.VelocityTimeZone}} token?
I've done everything you suggested. The email Preview-by-List view does not populate the token. And just after I felt soooo close. Bummer. Is this an indication of the VTL being broken somewhere or what could be causing this?
You'll have to add some debugging lines. If you just put
${display.list( $lead.entrySet(), "\u000a" )}
on a line by itself, that will show you what the lead object looks like in raw form. Go to the Text version of the email to look at the output, then you can post a screenshot.
This was the result of that line.
Interestingly in a different email template I used for testing it rendered differently. And I should note this version is the actual template this emails will be built from.
Do you have the required fields checked off in the tree on the right-hand side of Script Editor? Sure doesn't look like it.
Nope. I had no clue. Sorry. Your level of frustration must be approaching record levels.
I checked all 8 Product Subscribed and all 8 Product Subscribed Date only. Is that correct?
Here is the result of that...
That's better, but you said they were DateTimes... those are stringified Date fields.