How to remove auto generated message from email body in inbound email action

kalyani23
Tera Contributor

Hi,

we have created a inbound action to get email details ,which will create tickets when we receive mails from outlook , gmail .from the mail body  we need to search certain words that we have already defined in another custom table  but when we receive the mails from outlook we see the below content gets auto added at the end of email body.

"This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message."

So when reading the email body ,we need to eliminate the auto generated message from the body.

so we need some help on this, please provide some solution .

 

 

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi Kalyani,

You need to replace the disclaimer text with space in your inbound action scripts.

 

var declaimer = "This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message.";


var emailBody = email.body_text.replace(declaimer , '');

 

OR you can define a system property for the disclaimer message and call it in inbound action.

var desclaimer = gs.getProperty('desclaimer.message');

var emailBody = email.body_text.replace(desclaimer, '');

 

Regards,

Sagar Pagar

The world works with ServiceNow

View solution in original post

1 REPLY 1

Sagar Pagar
Tera Patron

Hi Kalyani,

You need to replace the disclaimer text with space in your inbound action scripts.

 

var declaimer = "This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message.";


var emailBody = email.body_text.replace(declaimer , '');

 

OR you can define a system property for the disclaimer message and call it in inbound action.

var desclaimer = gs.getProperty('desclaimer.message');

var emailBody = email.body_text.replace(desclaimer, '');

 

Regards,

Sagar Pagar

The world works with ServiceNow