How to use email reply separators?

kkrushkov
Mega Sage

Hello, Team!

I've been searching but haven't found any information on how to use email reply separators [sys_email_reply_separator] in an email inbound action script. Can anyone provide guidance or examples on this?

Thanks in advance!

Best regards,
KK

8 REPLIES 8

Hi @kkrushkov 

 

Email reply separators in ServiceNow are used to identify and strip out quoted text, previous email threads, or signatures from incoming email messages.

 

I have provided all the information above but looks that's not clear, let me give the explanation of javascript code which earlier i have shared:

 

  1. EmailUtil Class: The EmailUtil class provides methods for handling email content, including stripping out quoted text based on the reply separators defined in the sys_email_reply_separator table.
  2. extractReplyText Method: This method extracts the new content from the email body, stripping out any quoted text or previous email threads based on the reply separators.
  3. Clean Body Processing: After extracting the clean body, the script processes it as needed. In this example, it creates a new incident with the clean email content.

How to Test:

  1. Create a Test Email: Send a test email to the ServiceNow instance that includes quoted replies or signatures.
  2. Trigger the Inbound Action: Ensure the inbound email action is triggered by the test email.
  3. Check the Logs: Verify the logs to ensure the extractReplyText method has stripped out the quoted text as expected.
  4. Review the Incident: If the action creates or updates an incident, review the incident to ensure the clean email body is correctly processed and stored.

I hope this will provide more clarification and helps to resolve your issue, if yes please mark my answer helpful and correct.

 

thank you

Rajesh chopade

Can you please share the 'extractReplyText' method in the EmailUtil script include? I think that's what people are struggling with here. Thanks!

Vishwa Pandya19
Mega Sage

Hi @kkrushkov ,

 

did you find a solution for this? I have the same exact requirement and i'm stuck.

 

Regards,

Vishwa

Yvan1
Tera Contributor

Was this ever addressed?
The extractReplyText doesn't seem to exist in our OOB EmailUtil either.