You need to sign in to do that
Don't have an account?
FastSnail
Erratic behavior of VF Email template with specific words. Completely insane. Bug? Hackers?
Hello everyone. I can't believe that I am starting this discussion as it sounds crazy, illogical, insane. Still I have spent 10 hours, sent about 200 Emails with the template and I can't figure it out. The problem happens with ONE VF Email template. I am successfully using dozens of similar VF Email template using the SAME components, with no problem.
This particular template stops working when some particular words are used in the template. 'using' is one of them.
Here are the elements. First a component that I am using in all my templates without problem.
<apex:component access="global" language="{!lan}" id="CNOrgOwnAddBlo" >
<apex:attribute name="att" type="CNOrganization__c" description="" />
<apex:attribute name="lan" type="String" description="" />
<apex:outputText value="{!att.name}" escape="true" /><br/>
<apex:outputText value="{!att.LinkCNAddressBilling__r.AddQualif__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.AddQualif__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street1__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street1__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street2__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street2__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.City__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.RegionState__c} " rendered="{!att.LinkCNAddressBilling__r.RegionState__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.ZipCode__c}" rendered="{!att.LinkCNAddressBilling__r.ZipCode__c != '' }" />
<br/>
<apex:outputField value="{!att.LinkCNAddressBilling__r.Country__c}" />
</apex:component>
Then this particular template (just the piece to explain the problem).
The template below with ‘toto’ in the cell works fine. Now, replace ‘toto’ with ‘usi’, ‘usin’, ‘usinge’, ‘using2’, …. and all works fine (case1 in document attached). BUT replace with ‘using’ and the template stops working. The debug log does not show anything abnormal: just ‘using’ where is it supposed to be in the email. Still, the email does not fire (case2 in document attached).
<messaging:emailTemplate relatedToType="CNPosition__c" language="{!relatedTo.DocumentLanguage__c}" subject="{!$Label.CNWelcomeToTheCCNAdministratorComunity}" id="CNSubEvePubEmaTem" >
<messaging:htmlEmailBody>
<table align="center" width="600" style="width:600px;margin-left:auto;margin-right:auto;" >
<tr><td>
<c:CNOrgOwnAddBlo att="{!relatedTo.LinkCNOrgAcc__r}" lan="{!relatedTo.DocumentLanguage__c}" />
</td></tr>
<tr><td>
toto
</td></tr>
</table>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Now, if it helps someone diagnose the problem, simply remove the <br/> in the component <apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" and it all works fine with ‘using’ (case3 in document attached).
Because I realize it sounds crazy, the link below shows a few screenshots.
http://www.ccnfr.org/various/20160903-VFTemplateInsane.pdf
Well, thanks a lot for trying to figure this one out.
Jerome
This particular template stops working when some particular words are used in the template. 'using' is one of them.
Here are the elements. First a component that I am using in all my templates without problem.
<apex:component access="global" language="{!lan}" id="CNOrgOwnAddBlo" >
<apex:attribute name="att" type="CNOrganization__c" description="" />
<apex:attribute name="lan" type="String" description="" />
<apex:outputText value="{!att.name}" escape="true" /><br/>
<apex:outputText value="{!att.LinkCNAddressBilling__r.AddQualif__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.AddQualif__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street1__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street1__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.Street2__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.Street2__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" rendered="{!att.LinkCNAddressBilling__r.City__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.RegionState__c} " rendered="{!att.LinkCNAddressBilling__r.RegionState__c != '' }" escape="false" />
<apex:outputText value="{!att.LinkCNAddressBilling__r.ZipCode__c}" rendered="{!att.LinkCNAddressBilling__r.ZipCode__c != '' }" />
<br/>
<apex:outputField value="{!att.LinkCNAddressBilling__r.Country__c}" />
</apex:component>
Then this particular template (just the piece to explain the problem).
The template below with ‘toto’ in the cell works fine. Now, replace ‘toto’ with ‘usi’, ‘usin’, ‘usinge’, ‘using2’, …. and all works fine (case1 in document attached). BUT replace with ‘using’ and the template stops working. The debug log does not show anything abnormal: just ‘using’ where is it supposed to be in the email. Still, the email does not fire (case2 in document attached).
<messaging:emailTemplate relatedToType="CNPosition__c" language="{!relatedTo.DocumentLanguage__c}" subject="{!$Label.CNWelcomeToTheCCNAdministratorComunity}" id="CNSubEvePubEmaTem" >
<messaging:htmlEmailBody>
<table align="center" width="600" style="width:600px;margin-left:auto;margin-right:auto;" >
<tr><td>
<c:CNOrgOwnAddBlo att="{!relatedTo.LinkCNOrgAcc__r}" lan="{!relatedTo.DocumentLanguage__c}" />
</td></tr>
<tr><td>
toto
</td></tr>
</table>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Now, if it helps someone diagnose the problem, simply remove the <br/> in the component <apex:outputText value="{!att.LinkCNAddressBilling__r.City__c}<br/>" and it all works fine with ‘using’ (case3 in document attached).
Because I realize it sounds crazy, the link below shows a few screenshots.
http://www.ccnfr.org/various/20160903-VFTemplateInsane.pdf
Well, thanks a lot for trying to figure this one out.
Jerome
All Answers
Can you try using a custom label and then use that custom label in the template. Basically replace toto with a custom lable, then try changing the value of the custom label and see if the probelm persist.