The CreatorCon Call for Content is officially open! Get started here.

Remove email footer in inbound action

Mohamed Faizel
Giga Expert

Hi,

 

Is there any way to omit the outlook automated footer?

 

For our requirement, email body text will be placed in work-notes. In that work notes automated outlook footer also updated. can we omit the following line   using inbound actions?

"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. "

 

Please help on this.

 

Thanks,

Faizeal.

1 ACCEPTED SOLUTION

How about:



var footerText = "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(footerText, '');


View solution in original post

7 REPLIES 7

User140988
Kilo Guru

Hi Mohamed,



You can use the email.body_text in the inbound email action to get the body of the email in a variable, using indexOf operator you can find where the text is present in the email body and use string function substring to remove this part and then assign it to the worknotes field of the incident.



http://wiki.servicenow.com/index.php?title=Inbound_Email_Actions#Accessing_Email_Objects_with_Variab...


hi,



Thanks for your response, I tried the following script is it right?



var idx = email.body_text.indexOf('This e-mail');


  idx = email.body_text.length;  


  if (idx == -1)


  {


  var cmt = email.body_text.substring(idx+19,idx+230);  


  current.work_notes = cmt;


  }


How about:



var footerText = "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(footerText, '');


Thanks andrew. Working fine as expected



Thanks,
faizeal