Hello,
How can I pull in the values from my Velocity Token.
##check if HUG Event Choice is Chicago HUG
#if(${lead.HUG Event Choice} == "Seattle HUG: UserTesting Hacks (4/7 10 am Pacific)")
#set($event.title = "Seattle UserTesting Hacks HUG Event")
#set($event.date = "Thursday, April 7th at 10 AM PT")
#set($event.destination = "<a href="https://usertesting.zoom.us/j/98148200405?pwd=K0d3SFFJWFpvY1FMN2RQWWMvSXkvUT09" style="color: #315CFD; text-decoration: underline;" target="_blank">Remotely via Zoom</a>")
##check if HUG Event Choice is London HUG
………….
#end
for something like this. In the email if I want the event.title
how can I pull that field into the email?
is it something similar to this? ${{my.HUGEventChoice_event.title}}
My token name is {{my.HUGEventChoice}}
Solved! Go to Solution.
@freeza ,
getting out in front of the link question that'll be coming next. Do it like this. You don't need to replicate the styles, html etc. etc. etc.
#set( $allEventDetails = {
"Seattle HUG: UserTesting Hacks (4/7 10 am Pacific)" : {
"title":"Seattle UserTesting Hacks HUG Event",
"date":"Thursday, April 7th at 10 AM PT",
"destination":"usertesting.zoom.us/j/98148200405?pwd=K0d3SFFJWFpvY1FMN2RQWWMvSXkvUT09"
},
"London HUG: UserTesting Hacks (4/12 2 pm GMT)" : {
"title":"London UserTesting Hacks HUG Event",
"date":"Tuesday, April 12th at 2 PM GMT",
"destination":"usertesting.zoom.us/j/97207484508?pwd=dHRyakZ2c2orQ1FMM28vMk5aMU80QT09"
},
"Chicago HUG: UserTesting Hacks (4/19 10 am Central)" : {
"title":"Chicago UserTesting Hacks HUG Event",
"date":"Tuesday, April 19th at 10 AM CT",
"destination":"usertesting.zoom.us/j/97012930463?pwd=d2h0TGc4cXZYaTJ2ZWdDUGpCNkUxdz09"
},
"Texas HUG: UserTesting Hacks (4/28 10 am Central)" : {
"title":"Texas UserTesting Hacks HUG Event",
"date":"Thursday, April 28th at 10 AM CT",
"destination":"usertesting.zoom.us/j/94723137214?pwd=ZzZuNkZlWG1SM3M1VE80a3ZvdmZyUT09"
}
}
)
#set( $aEvent = $allEventDetails[$lead.hUGEventChoice])
<p>Title:${aEvent.title}</p>
<p><b>When:</b>${aEvent.when}</p>
<p><b>Where:</b><a href="https://${aEvent.where}" style="color: #315CFD; text-decoration: underline;" target="_blank">Remotely via Zoom</a></p>
That should be getting pretty close to what you need
You will need to create a separate velocity token to do that (i.e. just display the title), add that token in the subject line and you should be good to go! You'll be able to reference data set in the variable in your original token!
Yep. Just create a very simple token that has in it
${aEvent.title}
And pop that in the subject. Fortunately, Marketo does the body processing before the subject line processing, so the variable is all nicely set for use.
OK.. so a shorter version of what I wrote before (to save @SanfordWhiteman from having to find and restore my earlier reply)
so, my first comment originally was for you to use the code highlighter, but I see that's happened.
Then:
Cheers
Jo
Does this look good?
##check if HUG Event Choice is Seattle HUG
#if($(lead.hUGEventChoice.equals("Seattle HUG: UserTesting Hacks (4/7 10 am Pacific)"))
#set($event.title = "Seattle UserTesting Hacks HUG Event")
#set($event.date = "Thursday, April 7th at 10 AM PT")
#set($event.destination = "<a href="https://usertesting.zoom.us/j/98148200405?pwd=K0d3SFFJWFpvY1FMN2RQWWMvSXkvUT09" style="color: #315CFD; text-decoration: underline;" target="_blank">Remotely via Zoom</a>")
........
#end
Asides from the lack of syntax highlighting, there are many problems (syntax, and possibly business logic).
Let's step back. What are you actually trying to do here.
Cheers
Jo
I have this email content below is a screenshot. From the Velocity Token I have. I want the Event Title, When and Where to be generated according to the HUG Event the user choses.
So, the link I posted in an earlier reply is EXACTLY what you need with a few tiny tweaks
#set( $allEventDetails = {
"Seattle HUG: UserTesting Hacks (4/7 10 am Pacific)" : {
"when":"The right date and time for Seattle",
"where":"A link to your Seattle meeting - make sure and escape things like quotes"
},
"London HUG: Some Stuff about Hugs (4/7 10 am GMT)" : {
"when":"The right date and time for London",
"where":"A link to your London meeting - make sure and escape things like quotes"
},
"NZ Hug: It ain't all about the sheep" : {
"when":"The right date and time for New Zealand",
"where":"A link to your NZ meeting - make sure and escape things like quotes"
}
}
)
#set( $aEvent = $allEventDetails[$lead.hUGEventChoice])
<p><b>When:</b>${aEvent.when}</p>
<p><b>Where:</b>${aEvent.where}</p>
Put all that in a velocity token... then, where you want the output, put in the {{my.whateverYourTokenIsCalled}}
My usual caveat applies.. I've not tested or debugged this.
Cheers
Jo
So I have this,
But it keeps giving me an error. I attached the screenshot of the error I am getting.
This is how I am calling in the email
OK.. Nothing happening here is good.
you can't have all those quotes in the link like that (hence why I said they needed escaping).
Also, look at what the code is doing.... the final output stage outputs
Title: aEvent.title
When: aEvent.when
Where: aEvent.where
you only need to call the token once.
Just make your links (for now) some thing simple like the word BOB.
Then once you've got that working, I'll loop back to the links issue.
@freeza ,
getting out in front of the link question that'll be coming next. Do it like this. You don't need to replicate the styles, html etc. etc. etc.
#set( $allEventDetails = {
"Seattle HUG: UserTesting Hacks (4/7 10 am Pacific)" : {
"title":"Seattle UserTesting Hacks HUG Event",
"date":"Thursday, April 7th at 10 AM PT",
"destination":"usertesting.zoom.us/j/98148200405?pwd=K0d3SFFJWFpvY1FMN2RQWWMvSXkvUT09"
},
"London HUG: UserTesting Hacks (4/12 2 pm GMT)" : {
"title":"London UserTesting Hacks HUG Event",
"date":"Tuesday, April 12th at 2 PM GMT",
"destination":"usertesting.zoom.us/j/97207484508?pwd=dHRyakZ2c2orQ1FMM28vMk5aMU80QT09"
},
"Chicago HUG: UserTesting Hacks (4/19 10 am Central)" : {
"title":"Chicago UserTesting Hacks HUG Event",
"date":"Tuesday, April 19th at 10 AM CT",
"destination":"usertesting.zoom.us/j/97012930463?pwd=d2h0TGc4cXZYaTJ2ZWdDUGpCNkUxdz09"
},
"Texas HUG: UserTesting Hacks (4/28 10 am Central)" : {
"title":"Texas UserTesting Hacks HUG Event",
"date":"Thursday, April 28th at 10 AM CT",
"destination":"usertesting.zoom.us/j/94723137214?pwd=ZzZuNkZlWG1SM3M1VE80a3ZvdmZyUT09"
}
}
)
#set( $aEvent = $allEventDetails[$lead.hUGEventChoice])
<p>Title:${aEvent.title}</p>
<p><b>When:</b>${aEvent.when}</p>
<p><b>Where:</b><a href="https://${aEvent.where}" style="color: #315CFD; text-decoration: underline;" target="_blank">Remotely via Zoom</a></p>
That should be getting pretty close to what you need
Hi @Jo_Pitts1
this is pretty cool stuff. And it worked mostly when I was testing it.
What did not work for me was to request the title with
${aEvent.title}
Instead I had to use something like this.
#set( $aEventTitle = $allEventDetails[$lead.hUGEventChoice]['title'])
Is there anything I have to hold an eye on so I can use simply ${aEvent.title}?
Unfortunatly I was not able to get the JSON from a lead field. I assume the lead field delivers the JSON as string which is why I can't just lookup the key. Is this correct?
Is there maybe some function like:
#set( $allEventDetails = convert.toObject($lead.allEventDetails))
Or is there another way I can get the mapping list out of a lead field?
Kind regards
Wolfram
I do have one more question. Is there any possibility we can get the event.title to show in the Subject Line of an email?
Yep. Just create a very simple token that has in it
${aEvent.title}
And pop that in the subject. Fortunately, Marketo does the body processing before the subject line processing, so the variable is all nicely set for use.
If I have a deigned Add to Calendar section in my email for Google, Outlook and IOS. Is there’s a way to change their invite links according to the event the user has signed up for? So right now the email updates the title, when and where but if I have a Add to Calendar section with 3 separate columns saying Google, Outlook and IOS. Is there’s a way to generate their invitation links dynamically?
something like below
@freeza ,
Add all the parameters for the event into the keymap (the way you added title).
Then use a link to agical (read all about it here https://blog.teknkl.com/introducing-agical-io-the-smarter-ics-file-generator/). Essentially this is an extension of the logic used to create the zoom link.
I'm pretty certain you don't need a specific add to iOS option. You just need GCAL (google) and ICS (everything else).
Cheers
Jo
If I have to send Reminder Emails for all of these events. Do I have to create Separate Smart Campaigns or else can I do everything in 1 Smart Campaign?
Since Each event is in different date.
There are a few ways to skin that cat.
One would be to have a single smart campaign with all registrants in the audience, and wait steps to send each email on the right date (with a constraint to make sure the person was in that event).
The other is to set up <x> campaigns, one for each event, that is scheduled to fire <y> days before the event in question.
I'd probably go for the latter. It's much clearer what is going on.
Got it, thanks!
You can have additional parameters with the apt ics values (each for google/apple/outlook) for each of the HUG event in the velocity map and use that in the calendar section of the email based on the HUG event type. Assuming you would have your original token with all the data above this token - you can have a token that can display the calendar section and dynamically add the apt ics links based on the HUG event type referencing the respective ics links from the original token. You can also have a separate array locally defined in the velocity token - but IMO having all the info in a single array at one place in your original token wouldn’t hurt.
Thanks!
Great! Everything is working. Thank you guys!
You will need to create a separate velocity token to do that (i.e. just display the title), add that token in the subject line and you should be good to go! You'll be able to reference data set in the variable in your original token!