+ Start a Discussion
kd91179kd91179 

Unable to Approve records using email response

Hi,

 

I have created a custom object and created a Approval process for records that enter a certain criteria in that object. I have assigned a custom Visual Force Email Template to the Approval process. And based on the approval or rejection a field is updated approriately. While testing I was not able to approve the record, the steps that I followed are

 

  • Create a new record based on the critera
  • Click on the Submit for Approval button
  • I received email in the customer email template that I assigned in the user email address who will approve the record
  • I replied to the email with "Approve" in the first line (the reply went to something@something.wrkfl.salesforce.com)
  • There are no errors received but still record is still not approved.
Could someone point out what is happening here and what needs to been done to get this going.
Thanks
KD

 

Ritesh AswaneyRitesh Aswaney

If you navigate to Setup > Workflow & Approvals > Settings

There is a checkbox for 

Enabling email approval response lets users reply to email approval requests by typing APPROVE or REJECT in the first line and adding comments in the second line.

 

You might want to double-check whether this checkbox is checked.

vijaymindvijaymind

Yes Unable to approve or reject the records even Enable Email Approval Response check box is true.

what I am missing please suggest me ASAP.

 

Thanks Vijay

ramya patil_KVPramya patil_KVP

Hi,

 

I am also facing the same issue. I have created visualforce email template and tagged to approval process which will get trigger to Approver when some one request for approval.

 

When Approver tries to approve/reject through the email he/she received, approval response is not chenging accordingly in salesforce.

 

For the same approval process if I use standard email template which is created by salesforce, that time it is capturing and changing the approval status in salesforce as per the response provided by the approver through the email.

 

Can some one please suggest what might be the problem here. Is the problem with visualforce template or ?????

 

Thanks in advance........

crop1645crop1645

VF email templates work with approval email response feature. 

 

All done in V28.0 PROD

 

0. Enable Email Approval Response checkbox in Workflow & Approvals settings

1. I created a custom object Foo

2. I created a default approval process using the Jump Start Wizard, the approver was selected manually by the submitter

3. I created a simple VF template as shown below

4. I submitted an Approval Request from an instance of Foo

5. I replied to the email with 'APPROVE' in the first line

6. SFDC changed the approval status to Approved.

 

<messaging:emailTemplate subject="Please approve a Foo: {!relatedTo.name}" recipientType="User" relatedToType="Foo__c">


<messaging:htmlEmailBody >
   <html>
   <c:UtilVfEmailStyle />
        <body>
            <p class="captionValue">This is a request to have a test document approved. Details:</p>
            <p></p>
            <table class="vfEmail">
                <tr class="vfEmail">
                    <td class="caption">Submitted by:</td>
                    <td class="captionValue"><apex:outputText value="{!relatedTo.owner.name}"/></td>
                </tr>
                
                <tr class="vfEmail">
                    <td class="caption">Foo:</td>
                    <td class="captionValue"><apex:outputlink value="{!LEFT($Api.Partner_Server_URL_270,FIND('.com',$Api.Partner_Server_URL_270)+4)+relatedTo.id}">{!relatedTo.Name}</apex:outputlink></td>
                </tr>
                
            </table>
            <p class="captionValue"><apex:outputlink value="{!LEFT($Api.Partner_Server_URL_270,FIND('.com',$Api.Partner_Server_URL_270)+4)+relatedTo.id}">Click here</apex:outputlink> to approve/reject. Or, reply in the first line with APPROVE or REJECT. You can find all your pending approval requests on your SFDC Home tab.</p>
        </body>
    </html>
</messaging:htmlEmailBody>
<messaging:plainTextEmailBody >
This is a request to have a foo approved. Details:

Submitted by: {!relatedTo.owner.name}

Foo: {!LEFT($Api.Partner_Server_URL_270,FIND('.com',$Api.Partner_Server_URL_270)+4)+relatedTo.id}

Click on the Approval Request link to approve/reject. Or, replay with APPROVE or REJECT in the first line. You can find all your pending approval requests on your SFDC Home tab.
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 with stylesheet (just to show off VF ..not really necessary for the answer):

<apex:component access="global">
    <!-- rgb(73,178,212)  = Corporate blue
         rgb(193,193,196) = Light gray
         rgb(0,153,102) = Corporate green
    -->
    <style type="text/css">
        body {font-family: Trebuchet MS,sans-serif; font-size: small;}

        h1 {
            color: rgb(0,153,102);
            font-size: medium;
        }


        table.vfEmail {
            border-width: 1px;
            border-spacing: 0px;
            border-style: solid;
            border-color: rgb(73,178,212);
            background-color: #FFFFFF;
            margin-left: 0px; margin-right: auto;
            width: 80%; 
           }
        
         td.cellNumber {
            border-width: 1px;
            padding: 2px 2px 2px 2px;
            border-style: solid;
            border-color: rgb(73,178,212);
            background-color: #FFFFFF;
            color: #000000;
            font-size: small;
            text-align: right;
            vertical-align: top;
        }
        td.cellText {
            border-width: 1px;
            padding: 2px 2px 2px 2px;
            border-style: solid;
            border-color: rgb(73,178,212);
            background-color: #FFFFFF;
            color: #000000;
            font-size: small;
            text-align: left;
            vertical-align: top;
        }
        td.cellCurrency {
            border-width: 1px;
            padding: 2px 2px 2px 2px;
            border-style: solid;
            border-color: rgb(73,178,212);
            background-color: #FFFFFF;
            color: #000000;
            font-size: small;
            text-align: center;
            vertical-align: top;
        }
        td.caption {
            border-width: 0px;
            padding: 0px 10px 2px 5px;
            border-style: none;
            border-color: #000000;
            background-color: #FFFFFF;
            color: #000000;
            font-size: small;
            text-align: right;
            vertical-align: top;
        }
        td.captionValue {
            border-width: 0px;
            padding: 0px 5px 2px 0px;
            border-style: none;
            border-color: #000000;
            background-color: #FFFFFF;
            color: #000000;
            font-size: small;
            text-align: left;
            vertical-align: top;
        }
        th.vfEmail { 
            border-width: 1px ;
            padding: 0px ;
            border-style: solid ;
            border-color: rgb(73,178,212);
            background-color: rgb(73,178,212);
            color: #FFFFFF;
            font-size: small;
        }


        tr.vfEmail {
            padding: 0px 5px 0px 5px;
        }
        
    </style>
</apex:component>

Two things I learned along the way was:

 

1. If the approval request is sent to xxx@mydomain00.com but the email server forwards that mail to xxx@mydomain01.com, then the approval email response will get an error as you can't approve from an email address different than the original recipient.

2. If the approvers are a queue, then there is no:

"Email Approval" <somelonguniquifier>.d-idxheam.dl.wrkfl.salesforce.com>

 You have to enumerate actual users to get the reply to to be as above; no queues

 

Justin RhoadesJustin Rhoades

Hey everyone,

for who ever finds this post. One other thing you have to make sure is the user (via profile or permission set) has read access on the object that they are trying to approve. Hope I saved you time with this lol