Jotting directly into Salesforce

Last week, I started using Jott.com.  If you’re not familiar with their service, it is essentially a personal dictation secretary.  You call Jott.com, pick a contact from your address book and then start talking.  Jott.com transcribes your message and emails the person the resulting text as well as a link to listen to your recording.

We normally try to not excessively promote services and products on this blog, but we liked Jott.com so much that we decided to build Jott-2-Salesforce.  We leveraged Apex Email Services to automatically create a task in Salesforce every time we leave ourselves a message on Jott.  Here’s a generic version of the Class, have fun!

Global class Jott_Note_To_Self implements Messaging.inboundEmailHandler{

Global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope env ) {

    // Create an inboundEmailResult object for returning the result of the Apex Email Service
    Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
 
    // If unsubscribe is found in the subject line enter the if statement
        try {
             // Create a new Task
            Task t = new Task();
            t.Subject = email.subject;
            t.Description = email.plainTextBody;
            t.Status = ‘Not Started’;
            t.Priority = ‘Normal’;
            insert t;
         } catch (exception e) {
        }    

    // Return true and exit
    // True will confirm it is complete and no bounced email
    result.success = true;
    return result;
}   

static testMethod void testUnsubscribe() {

    // Create a new email and envelope object
   Messaging.InboundEmail email = new Messaging.InboundEmail() ;
   Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();

   // test with subject that matches the unsubscribe statement
   email.subject = ‘test jott’;
   env.fromAddress = ’support@salesforce.com’;
  
   // call the class and test it with the data in the testMethod
   Jott_Note_To_Self jott = new Jott_Note_To_Self();
   jott.handleInboundEmail(email, env );
                       
}

}

Related posts:

  1. No More Weekend Tasks
  2. Problems auto-forwarding Gmail to Salesforce
  3. Why spellcheck is needed throughout salesforce.com
  4. Validating email addresses in Apex
  5. Properly Formatting Names in Apex

3 Comments to “Jotting directly into Salesforce”

  1. KokaNo Gravatar Says:

    Thanks for posting this. I have used Jott and think I will use it more now with this script.

  2. Sean RehderNo Gravatar Says:

    So…if I am not a coder…but I am a Jott and Salesforce.com administrator…how do implement this on my SFDC org?

    btw…this is awesome!

  3. Create Salesforce Tasks Using Jott.com | Kao Consulting Inc. (KCI) | Product management, product marketing, and Salesforce.com services Says:

    [...] The folks at the consulting firm, MK Partners, created a quick and easy connector between Jott.com and Salesforce. [...]

Post a Comment