Find your content:

Search form

You are here

Trying to put server name into a URL for email template


I am using a visual force template. I can put the origin server in the email by doing:

{!LEFT($Api.Partner_Server_URL_140, FIND(".com/",$Api.Partner_Server_URL_140)+3)}

and when I an email sent I'll see:

However, when I try to use this in a URL which pulls in an image, I do:

<img src= "{!LEFT($Api.Partner_Server_URL_140, FIND(".com/",$Api.Partner_Server_URL_140)+3)}/servlet/servlet.ImageServer?id=015G0000001f7xo&oid=00DG0000000gUxRMAU" height="90"/>

I get:

Error:      VFTemplate1 line 13, column 154: The reference to entity "oid" must end with the ';' delimiter  
Error   Error: The reference to entity "oid" must end with the ';' delimiter.

So I try escaping the " " characters around the com by doing:

<img src= "{!LEFT($Api.Partner_Server_URL_140, FIND(\".com/\",$Api.Partner_Server_URL_140)+3)}/servlet/servlet.ImageServer?id=015G0000001f7xo&oid=00DG0000000gUxRMAU" height="90"/>

And, I get same error. Any ideas?


Attribution to: dublintech

Possible Suggestion/Solution #1

Fixed by hanging the " to ' around some of the parsing.:

<img src= "{!LEFT($Api.Partner_Server_URL_140, FIND('.com/',$Api.Partner_Server_URL_140)+3)}/servlet/servlet.ImageServer?id=015G0000001f7xo&oid=00DG0000000gUxRMAU" height="90"/>

Works with img and apex:image

Attribution to: dublintech
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content