Ask Search:
Sam HummelSam Hummel 

How to escape quotes in an Apex function within a Visualforce email template

I have a little Apex logic in my Visualforce email template.  It's a simple IF() statement that is supposed to determine which link is included in the email.  It all works great except that I can't figure out how to escape the quotes around the href url and have the link get properly rendered in the resulting email.  When I try \' or %60 or &rquot; the whole html string gets printed in the email without being rendered as a hyperlink.  Here's the function:

{! IF(OR(RelatedTo.Type = "xxxxx", RelatedTo.Type = "yyyyyyy"), "<a href='http://www.myorg.org/node/3188'>http://www.myorg.org/node/3188</a>", "<a href='http://www.myorg.org/node/3187'>http://www.myorg.org/node/3187</a>") }

I'm sure this is a dumb mistake, but I'm pulling my hair out with frustration, so I appreciate your patience.
Erica KuhlErica Kuhl
I would suggest posting this question to the Apex Developer Discussion Boards - they have a more technical slant that will help you get to your answer.