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
sinsiterrulezsinsiterrulez 

Distorted body in VF Email Template

Hi,

I have a VF email template which is sent via a Workflow on inserting a record.The VF email template was working fine in production but after just adding few new VF tags to the email the body gets populated with wierd data.

the VF tags added are: 

 

 

<apex:outputPanel >
<br/><br/><b><u>Comments for Support Provider:</u></b><br/><br/>
<apex:outputField value="{!relatedTo.Support_Request_Type_Others__c}"/><br/>
</apex:outputPanel>

  The field Support_Request_Type_Others__c is a long text area (32000 characters) field.

 

And now the email contains such kind of data: 

 

Comments for Support Provider:  if(!window.sfdcPage){window.sfdcPage = new ApexPage();} UserContext.initialize({"locale":"en_US","timeFormat":"h:mm a","today":"5\/26\/2010 5:22 PM","userPreferences":[{"index":112,"name":"HideInlineEditSplash","value":false} ,{"index":114,"name":"OverrideTaskSendNotification","value":false} ,{"index":115,"name":"DefaultTaskSendNotification","value":false} ,{"index":119,"name":"HideUserLayoutStdFieldInfo","value":false} ,{"index":116,"name":"HideRPPWarning","value":false} ,{"index":87,"name":"HideInlineSchedulingSplash","value":false} ,{"index":88,"name":"HideCRUCNotification","value":false} ,{"index":89,"name":"HideNewPLESplash","value":false} ,{"index":90,"name":"HideNewPLEWarnIE6","value":false} ,{"index":122,"name":"HideOverrideSharingMessage","value":false} ,{"index":91,"name":"HideProfileILEWarn","value":false} ,{"index":93,"name":"HideProfileElvVideo","value":false} ,{"index":97,"name":"ShowPicklistEditSplash","value":true} ,{"index":92,"name":"HideDataCategorySplash","value":false} ,{"index":128,"name":"ShowDealView","value":false} ,{"index":129,"name":"HideDealViewGuidedTour","value":false} ,{"index":132,"name":"HideKnowledgeFirstTimeSetupMsg","value":false} ,{"index":104,"name":"DefaultOffEntityPermsMsg","value":false} ,{"index":133,"name":"HideCSNWelcomeMessage","value":false} ,{"index":135,"name":"HideNewCsnSplash","value":false} ,{"index":101,"name":"HideBrowserWarning","value":false} ],"startOfWeek":"1","isAccessibleMode":false,"ampm":["AM","PM"],"userId":"00530000000zpuv","dateTimeFormat":"M\/d\/yyyy h:mm a","dateFormat":"M\/d\/yyyy","uiSkin":"Theme2","language":"en_US","siteUrlPrefix":""} );

 Though this problem is not faced in all the emails but few emails do get this data.

Also, just due to this issue the entire email body is distorted.

 

Can some please help on this or provide any insights as this issue is of high priority for the end user

 

Anand@SAASAnand@SAAS

Is the email template code inside the <messaging:htmlEmailBody> or <messaging:plainTextEmailBody>? Can you try the below instead of your code?

 

 

<!-- to avoid generating span/div tags use layout=none -->
<apex:outputPanel layout="none">
<br/><br/><b><u>Comments for Support Provider:</u></b><br/><br/>
<!-- Since this is a text field, output field is not of any relevance since the formatting is not important -->
{!relatedTo.Support_Request_Type_Others__c}<br/>
</apex:outputPanel>

 

 

sinsiterrulezsinsiterrulez

Hi Anand,

Thanks for replying!!

I do agree that outputfield tag is not reqd but the dat in that field is somewhat like this:

 

Salesforce:
Need help in it!!!


----------------------------------------
Visualforce:
Can manage!!

----------------------------------------
Force.com:
Help reqd....

----------------------------------------

 

 

IF i dont use an outputfield tag then the result is like this:

 

Salesforce:Need help in it!!!----------------------------------------Visualforce:Can manage!!----------------------------------------Force.com:Help reqd....----------------------------------------

 which I dont want as its not comprehendible.. so I had explicitly added the outputfield tag..

Also the code is within <messaging:htmlEmailBody> tag so i dont think its creating any issue

 

 

To reiterate this issue occurs only for few users where as for others its working fine..so can you please help in this

 

Thanks!!