Skip to content

Email Handler for Chatter

by Evan Callahan on May 23rd, 2010

I wrote an application for the Chatter Developer Challenge, which you can install free from the AppExchange.  It is called Email2Chatter, and it is an inbound email handler that automatically posts the subject and body text of email you send to your Chatter feed.

Email2Chatter supports email attachments, posting them to the Chatter feed for download, and also supports forwarded emails, which it attaches to the feed post as HTML or text.

Email2Chatter is available free of charge with complete source code under GPL license. Once you install the AppExchange package, you’ll need to configure the inbound email handler before you can send it email.

First, go to Setup => Develop => Email Services.  Create an email service:

  • Name: Chatter
  • Apex Class: ChatterEmail
  • Accept Attachments: All
  • Accept Email From: [your organization’s domain name]
  • Truncate Oversize: [checked]
  • Convert Text Attachments: [checked]
  • Active: [checked]

Next, click New Email Address:

  • Email Address: chatter
  • Active: [checked]
  • Context User: [name of system administrator]
  • Accept Email From: [your organization’s domain name]

Make note of the email address – that is where users can send or forward email and attachments to post to their Chatter feed.

From → Apex, Salesforce.com

14 Comments
  1. Nice entry, Evan!

  2. Justin permalink

    Are you authenticating based on the incoming email address because this can be easily spoof’d with any SMTP server that allows relaying.

    • The email only comes to Salesforce in the first place if sent to the “secret” email address provided to the service. But your point is well taken – if someone had the secret email address AND knew how to spoof the From address to match a user’s email in the Salesforce account, they would be able to post to Chatter and cause trouble.

      As far as I know, the standard Email-to-Salesforce feature has the same vulnerability. But I am open to suggestions for improving security.

  3. Melissa Elliott permalink

    I just installed this and it is working for some users. However, for some reason, it is not working for myself and the other system administrator. The only thing that is different about us is that our usernames are different than our email addresses on our user record. However, our email addresses match that of the email address in the email service. We are both full System admins and developers within our org. Any idea why this might not be working. We have tried to change make our usernames and email address match the email address that we are sending from but it is not working. Weird.

    • The code looks at your user-account email address, which must match the address from which you are sending to Chatter. Your Salesforce username should have nothing to do with it.

      Are you sending email to Salesforce from the same email address as your Salesforce user email? Is that email address allowed in the email service settings?

  4. Is there any API available in APEX to deal with a ZIP attachment (presuming the business requirement was for the email service to burst the ZIP apart and post the contents to the chatter feed separately)?

  5. Kent Greff permalink

    great app!

    I can’t seem to make the tag methods work when I email in.

    i.e. #case

    I am following the case but not the Owner.

  6. Colleen Dupuis permalink

    Hi Evan,
    I have a customer who just downloaded your application and can’t get the tagging feature to work. They want the email to appear in the chatter feed of an account or contact. Despite following the naming convention #account (acct name) they can’t get it to work. Any thoughts on what might be wrong?

    Thank you!!
    Colleen

  7. Mike Shroyer permalink

    I like what you’ve done.

    One request would be for the ability to email to a Chatter Group as well the User.

    Mike

  8. Hi all- I am not updating this application anymore, although the code is still freely available if you want to install the app and customize it yourself.

    Regards,
    -Evan

  9. Crystal permalink

    This is exactly what I’ve spent the last 2-3 hours looking for!

    I tried installing Email2Chatter, but come up with the package install error:
    Missing feature Apex Classes Installing this package requires the following feature and its associated permissions: Apex Classes

    In an attempt to fix this, I installed the “apex-lang managed” app, which includes the Apex classes, but it doesn’t appear to have done anything; I still get the Missing Feature error when I install Email2Chatter.

    Can you please clue me in to what I might be missing?

    Cheers,
    Crystal

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS