Happy Business Starts Here

Highlighted
Tutor

Visualforce Email Templates for Approvals in Salesforce for Quotes

Just sharing the wealth here after finally getting an approval email template to show related data fields. I found a developer forum post linking to an AppExchange package for product line items in email templates - https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016cYlEAI - and was able to modify it to make a visualforce email template to use in my approval workflows from the Zuora Quote object:

 

<messaging:emailTemplate recipientType="User"
    subject="Discount Approved by your Manager - onto Finance/Legal: {!relatedTo.name}"
    relatedToType="zqu__Quote__c"
    replyTo="sfdc@tune.com">
    
<messaging:htmlEmailBody >        
    <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center } 
               TD  {font-size: 11px; font-face: verdana } 
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="2">
        <p>Hello,</p>
        <p>Your quote with the following details has been approved by your manager. </p>
        <p>You can see the approval history on your quote within Salesforce. Currently assigned approvers can view all quotes awaiting their response on their home page. {https://tune.lightning.force.com} </p>
        <p>Up next is finance if you selected Net 30 terms and then to legal for complete approval. You will receive an alert when final approval has taken place and it's time to create the contract in Octiv.</p>
        <p>Below is a list of fields related to the Quote:<b> {!relatedTo.name}</b>.</p>
        <br/>Account: <i> {!relatedTo.Legal_Entity_Name__c}  </i>  
        <br/>Quote Owner: {!relatedTo.owner.name}
        <br/>Quote Total: {!ROUND(relatedTo.zqu__Previewed_Total__c,0)}
        <br/>Quote Term: {!ROUND(relatedTo.zqu__InitialTerm__c,0)} 
        <br/>Quote Start Date: {!relatedTo.zqu__StartDate__c} 
        
        <br/>Approval Status: {!relatedTo.zqu__ApprovalStatus__c}
              
        <p>Thanks,</p>
        <p>Operations Team</p> 
   
        <p/>                  
       </font>
       
        </body>
    </html>
</messaging:htmlEmailBody> 
    
<messaging:plainTextEmailBody >
Hello, 

Your quote with the following details has been approved by your manager. 

You can see the approval history on your quote within Salesforce. Currently assigned approvers can view all approvals awaiting their response on their home page. (https://tune.lightning.force.com)

You will receive an alert when final approval has taken place and it is time to create the contract. 
 
Below is a list of fields related to the Quote: {!relatedTo.name}

Account: {!relatedTo.Legal_Entity_Name__c}   
Quote Owner: {!relatedTo.owner.name}
Quote Total: {!ROUND(relatedTo.zqu__Previewed_Total__c,0)} 
Quote Term: {!ROUND(relatedTo.zqu__InitialTerm__c,0)} 
Quote Start Date: {!relatedTo.zqu__StartDate__c} 
Approval Status: {!relatedTo.zqu__ApprovalStatus__c}

Thank you,
Operations Team

</messaging:plainTextEmailBody>       
        
</messaging:emailTemplate>

Obviously, you'd modify the home page references to be your organization's URL but enjoy. So far so good on getting it to run accordingly for four of our steps. Now I just need to clone and modify for all the rejection steps. 

 

-Megan

 
3 REPLIES 3
Guru

Re: Visualforce Email Templates for Approvals in Salesforce for Quotes

You can substitute  

 {!ROUND(relatedTo.zqu__Previewed_Total__c,0)}

with

 

$<apex:outputText value="{0, number,###,###,##0.00}">
       <apex:param value="{!relatedTo.zqu__Previewed_Total__c}" />
 </apex:outputText>

To have a formated $ amount (we don't round but you can add that too)

 

Also use this for dates if you like

 

<apex:outputText value="{0,date,EEEE, MMMM dd, yyyy}">
    <apex:param value="{!relatedTo.zqu__StartDate__c}" /> 
</apex:outputText>

 

 

Maggie Longshore
Zuora Alumni

Re: Visualforce Email Templates for Approvals in Salesforce for Quotes

Thank you for sharing.  Much appreciated.



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Tutor

Re: Visualforce Email Templates for Approvals in Salesforce for Quotes

Thanks for sharing! That was going to be my next project!