+ Start a Discussion
TMangoTMango 

URLENCODE and Email Templates

I am trying to build an email template that will pass across some merge fields to ClickTools for a survey.  Because I want to pass across the Case Owner name and the Request Type name, I need to use the URLENCODE function to ensure that they are sent in the email as a hyperlink.  However, when trying to encode the Request Type, I am getting stuck.  Here is the URL I am using:

 

http://www.clicktools.com/survey?iv=[CLICKTOOLS ID]&q1={!Case.Date_Submitted__c}&q2={!urlencode(Case.OwnerFullName)}&q3={!urlencode(Case.Type)}

 

Here's what gets populated in the email:

 

http://www.clicktools.com/survey?iv=[CLICKTOOLS ID]&q1=1/18/2011&q2=Toni+Mangone&q3=

 

If I take the encode out of the hyperlink, it works --- but cuts off at the space in the Request Type field.  For example, for a Request Type of Enhancement Request, I want to pass the following:

 

http://www.clicktools.com/survey?iv=[CLICKTOOLS ID]&q1=1/18/2011&q2=Toni+Mangone&q3=Enhancement+Request

 

but without the URLENCODE I end up passing

 

http://www.clicktools.com/survey?iv=[CLICKTOOLS ID]&q1=1/18/2011&q2=Toni+Mangone&q3=Enhancement

 

What am I doing wrong with the syntax?  How do I get the case Type field to pass across correctly?