Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Why does my Apex visualforce email template change html hyperlinks in APEX Repeat

Code for apex repeat:

                     <apex:repeat var="QP" value="{!recipient.Quoted_Products__r}">
                        <tr>
                        <td  style="font-size:14px; color:black;font-family:verdana, arial, sans-serif; border-bottom: solid 1px black;"><a href="{!QP.Quote_Email_Product_URL__c}">{!QP.Product__c}</a></td>
                        <td align="right"  style="font-size:14px; color:black; border-bottom: solid 1px black; nowrap">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${!QP.Amount__c}0</td>
                        </tr>
                        <tr>
                        <td  style="font-size:10px; color:black;font-family:verdana, arial, sans-serif;nowrap"><div style="padding-left: 20px;">{!QP.Description__c}</div><br></br></td>
                        </tr>
                    </apex:repeat>

URL that is set by {!QP.Quote_Email_Product_URL__c} but the email template shows the URL as "/https://www.createspace.com/Services/TemplateInterior.jsp". Why is it adding an extra "/" before the URL address?

share|improve this question
    
Does the leading "/" not occur if you output the field separately (not in the repeat)? –  JimRae Feb 5 at 16:51
    
I had something similar but the "/" was not appearing. Could you check if the "/" is not in the field value too? –  T. Rossi Feb 5 at 17:08
    
There was a / in the html email template. I removed it, but now the APEX repeat is removing a / from the address so it appears https:/www.createspace.com href now looks like this in apex repeat "<a href="{!QP.Quote_Email_Product_URL__c}">{!QP.Product__c}</a>" –  Jason K Feb 5 at 19:27
add comment

1 Answer 1

up vote 0 down vote accepted

I found the answer. You cannot use href in APEX repeat without issues. I used apex:outputLink:

<*apex:outputLink value="{!QP.Quote_Email_Product_URL_c}">{!QP.Product_c}</apex:outputLink>*

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.