function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FastSnailFastSnail 

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}&nbsp;" 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
Best Answer chosen by FastSnail
FastSnailFastSnail
Thanks for the quick reply. I have found the issue. It is NOT a SFDC problem. The issue is that when some words are the template, such as 'using', 'manage', 'password', 'email', .... , the Email server of my provider was placing the email in the SPAM folder (I just founds 158 SFDC email in that folder). Change any of these words and the email is received in the mailbox. Oh well, 2 days lost, one lesson learn.

All Answers

Prateek Singh SengarPrateek Singh Sengar
Hi Jerome,
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. 
FastSnailFastSnail
Thanks for the quick reply. I have found the issue. It is NOT a SFDC problem. The issue is that when some words are the template, such as 'using', 'manage', 'password', 'email', .... , the Email server of my provider was placing the email in the SPAM folder (I just founds 158 SFDC email in that folder). Change any of these words and the email is received in the mailbox. Oh well, 2 days lost, one lesson learn.
This was selected as the best answer