We have an event that has multiple sessions. Each session has a specific login link. We don't want to send 8 different emails with each login link. Is there a way to use velocity scripting to do this? If so, is there a resource I can be pointed to for this?
Thanks!
Solved! Go to Solution.
That doesn't seem like the right way (it also starts with an #elseif which is a fatal syntax error in any case).
Didn't you imply the field contains all of the possible values, semicolon-delimited? In that case it doesn't equals() just one value.
The string needs to be split() on a semicolon, then you loop over the sub-values to look for matches.
How are you gathering the registrations? Is it a single form? One multi-valued field or several fields?
Single form, with checkboxes for each session. When each checkbox is selected, the values are concatenated into a field.
Though, that process can be updated to better accommodate solutions for getting the links in one email.
Below is the script I was attempting to utilize for this, but am unsure the tweaking needed:
#elseif ( $lead.EventOptions.equals("Event1") )
#set ( $EventTitle = "Event1 Title")
#set ( $DateTime = "March 12, 2021 at 10am")
#set ( $EventLink = "link")
#elseif ( $lead.EventOptions.equals("Event2") )
#set ( $EventTitle = "Event2 Title")
#set ( $DateTime = "March 13, 2021 at 11am")
#set ( $EventLink = "link")
#elseif ( $lead.EventOptions.equals("Event3") )
#set ( $EventTitle = "Event3 Title")
#set ( $DateTime = "March 14, 2021 at 12pm")
#set ( $EventLink = "link")
#else
#set ( $EventTitle = "")
#set ( $DateTime = "")
#set ( $EventLink = "")
#end
That doesn't seem like the right way (it also starts with an #elseif which is a fatal syntax error in any case).
Didn't you imply the field contains all of the possible values, semicolon-delimited? In that case it doesn't equals() just one value.
The string needs to be split() on a semicolon, then you loop over the sub-values to look for matches.
@SanfordWhiteman Thank you for the guidance. I will work to modify this and see if it works for me.