• ccopek
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 11
    Replies
I have encountered a strange problem with a visualforce email template. When I preview the template everything seems to be fine. It appears as I expect in the preview window of the salesforce interface, and the test emails that I send to myself via the 'Preview' button arrive without a problem. However, when the approval process rule triggers the email to be sent the only thing that my users are receiving is an email with the subject only...the body of the email is completely blank! I have yet to figure out why this is, so if anybody has any suggestions I would be very grateful.
Code:
<messaging:emailTemplate subject="New Web-to-Trial Request requires your Approval" recipientType="User" relatedToType="Opportunity">
<messaging:htmlEmailBody >
   <html>
     <body>
    
    <style type="text/css">
      p.regular {font-family: arial; size: 8pt;}
      p.small {font-family: arial; size 8pt; line-height: 100%}
    </style>  
    <p class="regular">
    <br>A New Trial Request has been submitted.</br>
    <br>Account: <apex:outputLabel >{!relatedTo.Account.Name}</apex:outputLabel></br>
    <br><apex:outputText >Requested By: {!relatedTo.Contact__r.Name}</apex:outputText></br> 
     <br>To approve, simply type 'Approved' in your response. You can also review the Opportunity or Approve online at https://emea.salesforce.com/{!relatedTo.Id}</br>
     </p>
     </body>
   </html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 


Message Edited by AKall on 01-16-2009 01:26 PM
  • January 16, 2009
  • Like
  • 0

My email template (below) works fine when using the "preview" function to populate the Recipient (WhoID) and RelatedTo (WhatID)  - but when a workflow rule triggers the emai lto be sent, it comes back blank as if it's not resolving the who or what correctly. .

Code:
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Account"
    subject="Your website Access"
    replyTo="anaddress@us.com" >

    <messaging:htmlEmailBody >        
    <html>
        <body>
        <p>Hello {!recipient.name}--</p>
        <p>Here is a list of the website access you users currently have for account {!relatedTo.name}:</p>
    <apex:datatable cellpadding="5" var="cts" value="{!relatedTo.Contacts}">
        <apex:column value="{!cts.Name}" headerValue="Name"/>
        <apex:column value="{!cts.Seat_Holder__c}" headerValue="Website Program Access"/>
        <apex:column value="{!cts.Email}" headerValue="Email" />
        <apex:column value="{!cts.Phone}" headerValue="Phone" />
    </apex:datatable>
        </body>
    </html>
    </messaging:htmlEmailBody> 
</messaging:emailTemplate>



I created a simple workflow rule that's called whenever a contact is edited. The workflow rule uses an email alert. The email Alert uses this template. I've checked to make sure the email template is for Contact objects, and that the Recipient is specified as Email Field: Email.

I must be missing something obvious..... any ideas?




Message Edited by icemft1976 on 10-24-2008 09:28 AM