2

I want to mimic the Approval response through email functionality with some custom object record updation depending on the response sent.

We can send the approval response by replying the approval request mail by typinq APPROVE, REJECT etc in the first line of the mail. I want to know how the same functionality can be used to send a value (Say i have an 'Event' custom object and have sent an invitation to the clients, and want to capture the invitees' response regarding their availability for the event) through mail back to my Salesforce instance and update (or even Create) a record.

Explanation regarding how the Approval Email Response works is also of much help

1 Answer 1

2

One approach:

To capture the response to an invitation sent by email, use the SFDC Apex Inbound Email Handler feature. The invitees would reply to an email address bound to the Apex inbound email handler (see doc on how this is done)

Your Apex Inbound Email Handler class has access to the from/to/subject/body of the invitee's response. You would interrogate the body for 'ACCEPTED' or 'DECLINED' or 'YES' or 'NO' or whatever keywords you decide are indicators of the invitee's action regarding the 'event'

Furthermore, the Apex Inbound Email Handler can do DML; updating your Event__c object with a child list of acceptances/rejections (or whatever)

To make this work, the outbound email to the invitees would need to contain the ID of the Event__c object, and that ID would need to be part of the reply from the invitee (otherwise you have no idea what event the respondent is responding to). This is similar to how SFDC does email-to-case where a thread id is added to every email exchange between the Support team and the customer. The thread_id points back at the Case SObject in question.

The SFDC Approval Process is pretty much a closed system wherein the approvers must be SFDC users. The SFDC Approve-by-email feature works only in the context of the SFDC Approval Process workflow

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .