If/else email script format?
Hi..
It's my first time trying to set up an email script - a simple if/else that writes content and links to an email, based on what's in a specific field - lead.lastRequestedAssetType. I found a quick tutorial site that covers this ( http://developers.marketo.com/documentation/velocity-script/ ), but it doesn't seem to be working in my example.
I've written this as a script:
## If webinar
#if(${lead.lastRequestedAssetType} == "Webinar")
#set($assetlink = "website.com/webinar ${lead.lastRequestedAssetType}.html")
## If White Paper
#elseif(${lead.lastRequestedAssetType} == "WhitePaper")
#set($assetlink = "whitepaper ${lead.lastRequestedAssetType}.pdf")
## If Case Study
#elseif(${lead.lastRequestedAssetType} == "CaseStudy")
#set($assetlink = "website.com/webinar${lead.lastRequestedAssetType}.pdf")
#else
#set($assetlink = "default.${lead.lastRequestedAssetType}.end of link")
#end
##print it out
${assetlink}
I have two problems:
1- When I test the email, It seems to be skipping all the if statements, and going to default, even though the database field is filled out correctly.
2- my result is exactly what's in the default: default.${lead.lastRequestedAssetType}.end of link
It's not filling in the lead.lastRequestedAssetType, to give me something like: "http:default.linktoitem.end of link"
Thank you for any suggestions.