I have an email alert partial set up to go to our sales team, where I'm have an issue is I'm not sure what token to use that will tell them if the person is attending or not attending when they have filled out the form. We are using the Event RSVP field below is how the checkboxes are set up.
Yes, I'm coming|true
No, I won't be there|false
Thanks!
Hi Jeffrey,
Is this Event RSVP field on the lead object in Marketo?
If so you could just leverage the {{lead.Event RSVP}} in the email. That should appear when you click on the tokens section in the email editor.
You could customize your email to look more reader friendly like
I am attending: {{lead.Event RSVP}}
Hope this helps
Floyd
Edit: Sorry just realised that the field is a checkbox. which would only display a 1 or 0 value. 1 = true and "blank" = false. If we need to make this more user friendly you may need to leverage email scripting token to replace the 1 with True and blank with False.
Process would be something like
1. Creating a Email Script "my token": Managing My Tokens - Marketo Docs - Product Documentation
2. Add velocity scripting code (example)
##check if the Event RSVP = 1
#if(${lead.Event RSVP} == "1")
## set display value is "Yes, I am attending"
#set($display = "Yes, I am attending")
#else
## set display value is "No, I am not attending"
#set($display = "No, I am not attending")
#end
##print the value
${display}
3. Add the mytoken value into the email.
Booleans are "1" or "" (empty string) in Velocity, not "1" or "0", see https://blog.teknkl.com/velocitip-boolean-string-number-and-message/ and https://blog.teknkl.com/marketo-vtl-strings-all-the-way-down/.
In the first linked post I describe how to use $display.message to choose output based on these Boolean-like strings; another way to do it is like
#set( $mktoBoolean = { "1" : true, "" : false } )
#if( $mktoBoolean[$lead.EventRSVP] )
Yes, I'm attending
#else
No, I'm not attending
#end
Finally, when posting code, use the Advanced Editor's syntax highlighter so it's readable.
Thanks for the correction Sanford. Not sure why I wrote 0 when I referred to it as blank in the same line.
Also thanks for the tip - brand new to posting in this forum.
Floyd
Thanks Floyd and Sanford, I tried both scripts and this is what is happening.
If I Select Yes, I'll be attending on the form, the email alert says No, I'm not attending.
Any ideas of to why this my be happening?
Jeff
Remember to check off your field in the tree on the right hand side of Script Editor.
It sounds like your field is not present in the Velocity context.
Hi Jeffrey
Can you confirm
Thanks
Floyd
Hi Floyd,
I can confirm the following:
Thanks,
Jeff
And the Script Editor checkbox, like I said.
A simpler answer may be to have two alerts - one for attendees, one for declined - so you can simply write in what you want it to say, rather than using a token. Use a choice step to send attendee version if Event RSVP = true; otherwise, send declined.