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
Andrée-Anne CouillardAndrée-Anne Couillard 

Visualforce email, fields do not merge, but work fine whit test

Hi,

We currently have a VF email template that goes out based on a Apex trigger that is working fine.
I cloned that email template and removed some unecessary fields to create a new email alert that would be released as part of a Proposal Acceptance Process.
When I test the e-mail template "send test to verify merged files" it works perfectly. When the e-mail is sent through the Approval process, no field at all is beeing merged.

The e-mail is currently being send only to me (no field view restriction) and also it is not calling any fields that have a field update action as part of this aproval process.

Fields are related to the OP and Proposal.


Any thoughts on that? 

Thanks!

E-mail Template:
------------------------------------------------------------------------------------------
Proposal Release Full Info

<messaging:emailTemplate recipientType="user"
    relatedToType="Opportunity"
    subject="Proposal released for Opportunity {!relatedTo.Opportunity_number__c} {!relatedTo.name}">
        
<messaging:htmlEmailBody >        
    <html>
        <body>
       
        <font face="arial">

            <p>The following Proposal has been released.</p>

            <br/>Opportunity Name: <b><a href="https://na13.salesforce.com/{!relatedTo.Id}">{!relatedTo.Name}</a></b>
            <br/>Account Name: <b><a href="https://na13.salesforce.com/{!relatedTo.Account.Id}">{!relatedTo.Account.name}</a></b>
            <br/>Opportunity Owner: <b>{!relatedTo.owner.name}</b>
            <br/>Territory: <b>{!relatedTo.Territory_Label__c}</b>
            <br/>
            <br/>Opportunity Amount: <b>{!relatedTo.Currency_Sign__c} <apex:outputText value="{0, number, ###,###.00}"><apex:param value="{!ROUND(relatedTo.Amount,0)}" /></apex:outputText> {!relatedTo.CurrencyIsoCode}</b>
            <br/>Opportunity Number: <b>{!relatedTo.Opportunity_number__c}</b>
            <br/>Proposal Number: <b>{!relatedTo.Proposal_Number__r.Name}</b>
                      
            <br/>
            <br/>
            
            <p/>                  
           
            <table border="0" cellpadding="5" cellspacing="0" >
            
                <tr style=""> 
                    <th style="font-family:arial, sans-serif; border-width: 1px; border-style: solid; color: #FFF; border-color: black;background-color: black;">Product Name</th>
                    <th style="font-family:arial, sans-serif; border-width: 1px; border-style: solid; color: #FFF; border-color: black;background-color: black;">Description</th>
                    <th style="font-family:arial, sans-serif; border-width: 1px; border-style: solid; color: #FFF; border-color: black;background-color: black;">Engagement Type</th>
                    <th style="font-family:arial, sans-serif; border-width: 1px; border-style: solid; color: #FFF; border-color: black;background-color: black;">Total Price</th>
                    <th style="font-family:arial, sans-serif; border-width: 1px; border-style: solid; color: #FFF; border-color: black;background-color: black;">Internal Price</th>
                    <th style="font-family:arial, sans-serif; border-width: 1px; border-style: solid; color: #FFF; border-color: black;background-color: black;">Product Line</th>
                </tr>
       
                <apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
                   <tr>
                       <!-- <td><a href="https://na1-blitz01.soma.salesforce.com/{!opp.id}">View</a> |   -->
                       <!-- <a href="https://na1-blitz01.soma.salesforce.com/{!opp.id}/e">Edit</a></td> -->
                       <td style= "font-family:arial, sans-serif; border-width: 1px;border-style: solid;border-color: black;">{!opp.PricebookEntry.Product2.Name}</td>
                       <td style= "font-family:arial, sans-serif; border-width: 1px;border-style: solid;border-color: black;">{!opp.Description}</td>
                       <td style= "font-family:arial, sans-serif; border-width: 1px;border-style: solid;border-color: black;">{!opp.Engagement_type__c}</td>
                       <td style= "font-family:arial, sans-serif; border-width: 1px;border-style: solid;border-color: black;">{!relatedTo.Currency_Sign__c}<apex:outputText value="{0, number, ###,###}"><apex:param value="{!ROUND(opp.TotalPrice,0)}" /></apex:outputText></td>
                       <td style= "font-family:arial, sans-serif; border-width: 1px;border-style: solid;border-color: black;">{!relatedTo.Currency_Sign__c}<apex:outputText value="{0, number, ###,###}"><apex:param value="{!ROUND(opp.Internal_Price__c,0)}" /></apex:outputText></td>
                       <td style= "font-family:arial, sans-serif; border-width: 1px;border-style: solid;border-color: black;">{!opp.PricebookEntry.Product2.Product_Line__c}</td>
                   </tr>
                </apex:repeat>                 
                
           </table>
           <p/>
    </font>
       
    </body>
    </html>
</messaging:htmlEmailBody> 
</messaging:emailTemplate>