Does anyone have really beginner-level resources for learning how to do email script tokening? I've never done it before and feel like I missing out on some really cool/useful stuff.
One of the problems I'm trying to solve is:
If the lead picks "Consultant A" then show "Schedule Consultation" (with a hyperlink to Consultant A's calendar.)
then,
If the lead picks "Consultant B" then show "Schedule Consultation" (with a hyperlink to Consultant B's calendar.)
Lastly,
if the lead picks "Unsure" then show "Schedule Consultation" (with a hyperlink to Consultant A's calendar, b/c they are our default.)
I've read a couple of Sanford Whiteman blogs, and I feel like they are way over my head.
All help appreciated!
Solved! Go to Solution.
Something I mention in my Velocity classes is that the language was originally created as an easier-to-use, faster-to-market way to write code in a Java shop. Meaning it was still expected to be used by developers -- maybe very junior ones, but not folks who had zero interest in/exposure to datatypes and OO ideas.
It's apparent from the Velocity Tools docs that you're supposed to know what an int[] is (an array of int primitives) and there's no special explanation of stuff like that. Even when introducing the very simple #foreach/#end structures, there's mention of Collections and Iterators, which you could skip over and still write good code but there's a clue to a wider world.
Velocity does a ton of automatic type juggling for you that Java would never do, making it without a doubt exponentially faster for writing emails, web pages, or other text output. But if you ignore the Java underpinnings, you'll be confused when you run into a fatal error thrown from Java-land (like aStringIndexOutOfBoundsException).
I'm planning some short(ish) posts on the Marketo blog to deal with individual technical details of Velocity. They won't be dumbed-down, though, there's just no way to do that.
Well, learning Velocity is far from an overnight thing.
The reason VTL can seem obscure is... it's real code! Velocity is a real language running on top of Java. (And don't listen to anyone who says it's easy, that's a sign that they aren't a power user.)
As Velocity is very verbose, you want to use collection-centric code.
#set( $consultantLinks = {
"Consultant A" : "www.example.com/bookwithA",
"Consultant B" : "www.example.com/bookwithB",
"Unsure" : "www.example.com/bookGeneric"
} )
<a href="https://${consultantLinks[$lead.ChosenConsultant]}">Click to schedule</a>
Although I am using Email Scripts for years, I still consider myself a beginner - just because I don't speak Java. I kinda understand what Sandford is telling you with the "collection", so I would copy the script, file it somewhere in my own script library, then test it, love it, use it, and thank him sincerely.
Couple of tips:
And no, there are no beginner-level resources out there. If there were, I would have found them. I googled this stuff A LOT. But you're right: If you don't know about scripts, you're missing out. But moving in tiny steps from simple to complex will get you somewhere eventually. We have like ten Marketo users in our organization who are comfortable editing their own scripts, understand them and come up with ideas to build new ones. And none of them are developers.
Something I mention in my Velocity classes is that the language was originally created as an easier-to-use, faster-to-market way to write code in a Java shop. Meaning it was still expected to be used by developers -- maybe very junior ones, but not folks who had zero interest in/exposure to datatypes and OO ideas.
It's apparent from the Velocity Tools docs that you're supposed to know what an int[] is (an array of int primitives) and there's no special explanation of stuff like that. Even when introducing the very simple #foreach/#end structures, there's mention of Collections and Iterators, which you could skip over and still write good code but there's a clue to a wider world.
Velocity does a ton of automatic type juggling for you that Java would never do, making it without a doubt exponentially faster for writing emails, web pages, or other text output. But if you ignore the Java underpinnings, you'll be confused when you run into a fatal error thrown from Java-land (like aStringIndexOutOfBoundsException).
I'm planning some short(ish) posts on the Marketo blog to deal with individual technical details of Velocity. They won't be dumbed-down, though, there's just no way to do that.
Thank you for putting it more in perspective Sanford. I'm definitely sure its no easy topic to learn, but a worthwhile one.
I'll keep an eye out for your blogs and maybe when I become a little more experienced I can come back and decipher them!