- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2014 11:02 AM
Hi,
I've noticed that when an Incident is updated via email, the activity feed quickly becomes very clogged and hard to read - when customers reply via email, the comment that is added contains the entire body of the email that they are replying to. This leads to very long comments that contain a lot of duplicated text. Is there an easy way to filter incoming messages so that only the customer's response is added to the Comments section of the Incident? I'm thinking I could use a <HR></HR> tag or something similar and include a "Don't write below this line" message in the outbound notification email, and then filter out everything below that in the inbound mail, but am unsure how to go about setting that up. I think initially our email config was done by the previous administrator with help from our implementation partner so I really don't have much insight as to how that works.
Thanks!
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2014 08:12 AM
Thanks for the suggestions and help everyone. I ended up using the method outlined here:
http://glassputan.wordpress.com/2012/03/08/managing-email-replies/
It seems to be working great in my DEV instance, will push it live today.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2014 10:45 AM
Awesome, thanks!
email.body_text.replace(/<div style='display:inline'>Ref:MSG.*/,'')
That's all I would have to put in the Inbound action for it to delete the REF and everything after it?
What would be the code for it to cut everything off after the first <hr/>?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2014 10:53 AM
Hi Alan,
Yes, if you replace any reference in the inbound action to email.body_text with the line above containing the regex replace, it should replace the full contents of the email with everything after the first occurrence of the Ref and everything after it. To replace the hr, you would substitute email.body_text with:
email.body_text.replace(/<hr\/>.*/, '')
Make sure you test these as I have not thoroughly tested the regex's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2014 06:36 AM
I got to thinking and decided that removing everything after a <div> in the email.body_html would work well too if it's an HTML message which most emails seem to be (and I'll make a backup one looking for text if it comes in without html for some reason).
But I can't get the .* or */ to work cause .* gives a syntax error and */ starts commenting out things.
email.body_html.replace('<div>',''); seems to work but of course that doesn't replace everything after the <div> Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2014 07:36 AM
Hi Alan,
If I understand correctly, the following regex should select everything after the first <div> tag:
/<div>.*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2014 08:12 AM
Thanks for the suggestions and help everyone. I ended up using the method outlined here:
http://glassputan.wordpress.com/2012/03/08/managing-email-replies/
It seems to be working great in my DEV instance, will push it live today.