Started: 4/7/2010 8:46 AM | |  | |
|
| Parsing the body of an e-mail sent to SharePoint? Afternoon all, Has anyone done anything with parsing e-mails that have been sent to an e-mail enabled SharePoint list/library/DB, etc? Scenario: We need to follow up on customer sat surveys. The Director wants a way to track that follow up is being done. A manager would forward an e-mail to SharePoint that contains survey data (the e-mail comes to the manager from a 3rd party). Ideally, we could parse out information from the body of the e-mail and put it into columns in the list/library/etc. I'm not a code head, but don't know if this can be accomplished w/o VB/C#, etc. Thoughts? -Kat |
 |
|
| I am currently working on a similar solution, but running into some caveats. To do what you want to do, you'll probably want to use a discussion list as this exposes the "body" field of the email as a column in the list. (I went through a list, then a library and eventually ended up using the discussion board template). Now for parsing out information - we are lucky as we are using Nintex for our workflows and they provide a "regular expression" action (could probably do something similar with SharePoint designer). The biggest issue I have is that workflows cannot start automatically when an item is created (post SP1 security fix - launching workflows as the system account). The recommended fix for this is contained in KB953289. Does anyone have experience with running this stsadm command: stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv
true
I don't want to mess up any of my other currently running workflows. Hope this helps, Brian Merrifield
|
 |
|
| Here is a good post for SharePoint Designer and using regular expressions. Expresso is a tool that will be handy for creating/testing your regular expressions. -Brian
|
 |
Posted: 4/9/2010 11:56 AM | |  | |
|
| Clayton Cobb  |
| Brian, how would you use those methods to parse out metadata from an email? I'm curious on that as I use SPD a lot, and I can't understand from that article how this would be used with incoming email on a list. I'm not getting it yet. As for not being able to start workflows with incoming emails, that is the whole point of that fix, so it is a proper one to do. That's what you're supposed to do to work around the security change made in SP1. |
 |
Posted: 4/12/2010 6:24 AM | |  | |
|
| For a short explanation of what I'm trying to accomplish, here's the scenario. Basically we had a very "noisy" DL that received tons of email - so much so that useful information was easily lost in the volume of email received. The body of the email contains a simple string of information, of which I want to parse out into five individual columns of information. Via a workflow that starts automatically on new items in a discussion list, I can weed out emails of zero importance and then act on ones that have pertinent information. Using SharePoint, we can get item counts in a list to notice trends and actually see common problems as patterns - rather than the same monotonous emails that we keep getting. Hopefully once I haven't running correctly (this week?), I can share more info. Brian
|
 |
Posted: 4/12/2010 2:56 PM | |  | |
|
| Clayton Cobb  |
| How does SharePoint know how to take random text and put it in a column? Are the strings all formatted the same way? there must be something I'm missing. Which piece of the email identifies itself to SharePoint as belonging in a specific pre-defined column?
|
 |
Posted: 4/21/2010 5:30 PM | |  | |
|
| Sorry for the late reply, been a little busy at work (thanks McAfee).
Anyways, basically all the strings are the same format so its fairly easy to parse out. We are finalizing the RegEx for a couple oddballs, but for the most part its working.
I'm receiving the incoming email, ditching the original message since the "body" field is what I'm parsing. I parse that field via a RegEx and store what I need into a few variables, then set a field via the value of the variable.
More info later once I fully have it up and running, and run that STS command.
Brian
|
 |
Posted: 4/25/2010 2:41 PM | |  | |
|
| Clayton Cobb  |
| I'm not familiar with the term RegEx, so I look forward to seeing the result. I can't even visualize how something could logically parse out random text from an email body with no tags, so this will be awesome to see.
|
 |
Posted: 8/18/2010 8:25 AM | |  | |
|
|
Hi Brian,
Just wondering how you went on this? I'm looking into parsing an email body as well and came upon this post. How did you go about building the string after matching the RegEx? Cheers, Marc |
 |