0

i have requirement like below. Send email through workflow > user receives email and filled some information like grades, agree , not agreed and bla bla.. >submit and these data has to be stored in my SFDC org.

any help on this .

thanks in advance .

7
  • 1
    Check out email services(developer.salesforce.com/page/Force.com_Email_Services).. This should help you out.. – Sam Jun 16 '15 at 12:23
  • @Mugambo that is not my requirement. :) – Cloud Arch Jun 16 '15 at 12:37
  • What object is going to kick off the workflow that sends the email? – crmprogdev Jun 16 '15 at 12:46
  • 1
    How are your users going to fill in this data? A link in the email to a VisualForce page that has a form on it? Simply replying to the email? It's hard to answer your question without this information. – Daniel Bernsons Jun 16 '15 at 13:55
  • 1
    @CloudArch I would strongly advise against that for many reasons. This post may be from 2009, but many of the reasons still stand today. So you're left with two choices, either asking your users to reply, or linking to a VisualForce page. If linking to a page, the controller can handle submitting to SF. If an email reply, then an Inbound Email Service as detailed by Mugambo and ajay is your best option. – Daniel Bernsons Jun 16 '15 at 14:28
0

Email Services are one way to do this. Given the following example, you'd be able to send an email whose subject is the Account Id, body is the Account Name, and for storing create a field in your org and update it accordingly:

create a new Apex class "AccountUpdateEmailHandler" containing this code:

global class AccountUpdateEmailHandler implements Messaging.InboundEmailHandler {
  global Messaging.InboundEmailResult handleInboundEmail(
  Messaging.InboundEmail email,
  Messaging.InboundEnvelope envelope)
  {
    String subject = email.subject;
    Pattern idPattern = Pattern.compile('001[A-Za-z0-9]{12}');
    Matcher matcher = idPattern.matcher(subject);
    if (!matcher.find()) System.assert(false, 'No Account Id in subject!');

    Account account = [SELECT Name FROM Account WHERE Id = :matcher.group(0)];
    account.Name = email.plainTextBody;
    update account;

    Messaging.InboundEmailresult result = new Messaging.InboundEmailResult();
    result.message = 'Account Name is now ' + account.Name;
    return result;
  }
}

from Setup > Develop > Email Services, create one using the above class and Activate it.

and for any help visit this link:-

https://developer.salesforce.com/page/An_Introduction_To_Email_Services_on_Force.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.