Email scripting lexical error
Hi guys
I'm struggling with an email script and I'm hoping that someone can help me debug. It seems pretty straightforward...or so I thought!
I've replaced our domain and the field name with placeholders, but otherwise this is how the script appears:
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Australia-600x350.jpg")
#if(${lead.fieldname} == "Australia")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Australia-600x350.jpg")
#elseif(${lead.fieldname} == "Burgundy")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Burgundy-600x350.jpg")
#elseif(${lead.fieldname} == "Costa Rica")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Costa-Rica-600x350.jpg")
#elseif(${lead.fieldname} == "India")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/India-600x350.jpg")
#elseif(${lead.fieldname} == "Japan")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Japan-600x350.jpg")
#elseif(${lead.fieldname} == "Namibia")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Namibia-600x350.jpg")
#elseif(${lead.fieldname} == "Peru")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/Peru-600x350.jpg")
#elseif(${lead.fieldname} == "USA")
#set($HeaderImageURL = "letsgo.brand/rs/110-AIL-152/images/USA-600x350.jpg")
#else
#end
$HeaderImageURL
The email script token is called "{{my.Header_Image}}". In the HTML itself, the image looks like this:
<img src="{{my.Header_Image}}" width="600" border="0" class="deviceWidth" style="display:block;border-width:0;-ms-interpolation-mode:bicubic;"/>
I don't even get an error when I send a sample email, or a live deployment. The email soft bounces, and I get this error in the activity log:
System send failure: Velocity transform failed: ; The nested exception is: <cntrl char>org.apache.velocity.exception.ParseErrorException: Lexical error, Encountered: " " (160), after : "" at *unset*[line 279, column 40] |
I know that's referring to the Velocity script, but I can't see the error in my code. Any ideas?
Thanks, Phil