Hi all, I'm hoping someone can help with the following.
I've created a folder of snippets that contain very short messages to promote the various products and services of our company.
Our nurture program emails promote relevant content but I'd also like to add a randomly assigned snippet to every email that goes out that contains a sales note such as 'Take a look at our upcoming events at...' for example.
I understand I will need to use Velocity but have not knowledge/experience of using this.
Can anyone advise as to how to add snippets to each nurture program email in a way that will randomly show one of the snippets in every email that is sent/
Thanks,
Paul
Solved! Go to Solution.
I can't see the syntax highlighter above when creating an email script token.Iis that why it's not working for me?
The syntax highlighter is for here in the Community, not in Marketo! Click the name of the thread to open the full thread page, then when you reply you can see the Advanced Editor link at the upper right:
When you paste code without highlighting it, the Jive Community platform makes it unreadable. It needs to be in monospace (Courier) and laid out the way the syntax highlighter does it:
#set( $random = $math.random(0,3) )
#set( $linkText = {
0 : 'QS runs a number of global events for HE professionals, including <a href="https://www.reimagine-education.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">Reimagine Education</a> and <a href="https://www.edudatasummit.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">The EduData Summit</a>. <a href="https://www.qs.com/higher-education-tl-conferences/?utm_source=nurture&utm_medium=email" target="_blank" id="">Click here for more information and to view our events</a>.',
1 : 'Does your institution want to recruit more students? Check out <a href="https://www.qs.com/solutions/online-marketing/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS’ online advertising</a> options or <a href="http://info.qs.com/2019-01-14-Advertising-Options-and-Call-Back-Request_01-Landing-Page-with-Form.ht..." target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.',
2 : 'Is your institution looking for ways to differentiate from its competitors? Take a look at <a href="https://www.qs.com/solutions/research-intelligence/qs-stars/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS Stars</a> or <a href="http://info.qs.com/2019-01-14QSStarsandCallBackRequest_01LandingPage.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.'
})
There's nothing actually wrong with your code, you just forgot to output anything. Add:
${linkText[$random]}
Have you read this blog post?
Thanks for this.
So would I need to add the name of each snippet instead of the subject lines to make this work?
Ah, no. You can't switch literal snippets (as in Snippets™) this way. You would be switching between blocks of text included in the Velocity token.
If you truly must switch between predefined Snippets™ then you'd need to embed all the snippets in the email, then wrap each one in Velocity tokens that either output nothing or output HTML <!-- and --> around the ones to hide. I've done this before but it's pretty envelope-pushing if you're not comfy in Velocity.
The other way to go about this is to create a special segmentation to manage the random cohorts (i.e. use Random Sample to sort people into a set of Static Lists, then segment based on Member of List). This would allow you to use Dynamic Snippets™ in the typical fashion.
Thanks again for your help.
Are you able to provide an example like you did in the first response but where each bit of link text is instead html text, and then I could use that as the sales messages instead of snippets.
Does that sound right or am I misunderstanding?
You can put any text you want in the quotation marks, including HTML tags.
Use single quotes instead of escaped double quotes, though (because Velocity doesn't understand \").
{
"0" : "<div class='rnd'>something</div>"
}
not
{
"0" : "<div class=\"rnd\">something</div>"
}
though of course keeping extra markup/classes out of the random parts is best, for clarity if nothing else.
If I put the following code in to the html of the body of an email, it just shows the full text of the below within the email.
is there something I should put before and after to make it work?
Thanks
#set( $random = $math.random(0,3) )
#set( $linkText = {
0 : ‘<p>QS runs a number of global events for HE professionals, including <a href="https://www.reimagine-education.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">Reimagine Education</a> and <a href="https://www.edudatasummit.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">The EduData Summit</a>. <a href="https://www.qs.com/higher-education-tl-conferences/?utm_source=nurture&utm_medium=email" target="_blank" id="">Click here for more information and to view our events</a>. <br /></p>’,
1 : ‘<p>Does your institution want to recruit more students? Check out <a href="https://www.qs.com/solutions/online-marketing/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS’ online advertising</a> options or <a href="http://info.qs.com/2019-01-14-Advertising-Options-and-Call-Back-Request_01-Landing-Page-with-Form.ht..." target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.</p>’,
2 : ‘<p>Is your institution looking for ways to differentiate from its competitors? Take a look at <a href="https://www.qs.com/solutions/research-intelligence/qs-stars/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS Stars</a> or <a href="http://info.qs.com/2019-01-14QSStarsandCallBackRequest_01LandingPage.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information. <br /></p>’
})
Velocity code goes inside an Email Script {{my.token}}. Then that {{my.token}} is embedded in the email (just like a Text or Rich Text {{my.token}}).
Also, when posting code, be sure to highlight it using the Advanced Editor's syntax highlighter so it's readable:
Hi Sanford.
I put the following in to an email script token, then sent myself an email test that included that token. The email was delivered but there was just blank space where the token should have been.
I can't see the syntax highlighter above when creating an email script token.Iis that why it's not working for me?
Is there a software/website you use to insert the syntax highlighter before pasting it in to the email script token?
Thanks again for your support. It feels like I'm very close to being able to do this.
#set( $random = $math.random(0,3) )
#set( $linkText = {
0 : 'QS runs a number of global events for HE professionals, including <a href="https://www.reimagine-education.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">Reimagine Education</a> and <a href="https://www.edudatasummit.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">The EduData Summit</a>. <a href="https://www.qs.com/higher-education-tl-conferences/?utm_source=nurture&utm_medium=email" target="_blank" id="">Click here for more information and to view our events</a>.',
1 : 'Does your institution want to recruit more students? Check out <a href="https://www.qs.com/solutions/online-marketing/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS’ online advertising</a> options or <a href="http://info.qs.com/2019-01-14-Advertising-Options-and-Call-Back-Request_01-Landing-Page-with-Form.ht..." target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.',
2 : 'Is your institution looking for ways to differentiate from its competitors? Take a look at <a href="https://www.qs.com/solutions/research-intelligence/qs-stars/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS Stars</a> or <a href="http://info.qs.com/2019-01-14QSStarsandCallBackRequest_01LandingPage.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.'
})
I can't see the syntax highlighter above when creating an email script token.Iis that why it's not working for me?
The syntax highlighter is for here in the Community, not in Marketo! Click the name of the thread to open the full thread page, then when you reply you can see the Advanced Editor link at the upper right:
When you paste code without highlighting it, the Jive Community platform makes it unreadable. It needs to be in monospace (Courier) and laid out the way the syntax highlighter does it:
#set( $random = $math.random(0,3) )
#set( $linkText = {
0 : 'QS runs a number of global events for HE professionals, including <a href="https://www.reimagine-education.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">Reimagine Education</a> and <a href="https://www.edudatasummit.com/?utm_source=qs_b2bmarketing&utm_medium=qs_b2bmarketing" target="_blank" id="">The EduData Summit</a>. <a href="https://www.qs.com/higher-education-tl-conferences/?utm_source=nurture&utm_medium=email" target="_blank" id="">Click here for more information and to view our events</a>.',
1 : 'Does your institution want to recruit more students? Check out <a href="https://www.qs.com/solutions/online-marketing/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS’ online advertising</a> options or <a href="http://info.qs.com/2019-01-14-Advertising-Options-and-Call-Back-Request_01-Landing-Page-with-Form.ht..." target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.',
2 : 'Is your institution looking for ways to differentiate from its competitors? Take a look at <a href="https://www.qs.com/solutions/research-intelligence/qs-stars/?utm_source=nurture&utm_medium=email" target="_blank" id="">QS Stars</a> or <a href="http://info.qs.com/2019-01-14QSStarsandCallBackRequest_01LandingPage.html" target="_blank" id="">click here to request a call back</a> and we’ll be in touch with more information.'
})
There's nothing actually wrong with your code, you just forgot to output anything. Add:
${linkText[$random]}