Inbound Email Action to only capture in Work Notes - and not capture actual email

wmahmud
Kilo Contributor

Hello,

 

Essentailly what I am looking to do is capture the reply of an email (entire email and chain) into the work notes field, but not capture the actual email as well in the activity log.

 

Can someone advise how to set this up and if possible?

 

Right now I used this;

-----

gs.include('validators');


if (current.getTableName() == "incident") {
current.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.update();


}

------

 

Is there a way to update this to achieve what I am looking to do?

8 REPLIES 8

Harish Murikina
Tera Guru

current.work_notes = email.body_text;


Hi Harish,



I can capture the email in work notes, that was never an issue before when I setup either, the problem is the email itself is still being captured as well, I want to try and stop the email from being captured in the Activity Log, and just have the body captured in Work Notes.



Your solution below still captures the email as well.


Waqas,



I apologize if this isn't too much help. However the easiest method I can think of to achieve this would be to see if there is a common piece of text that is unique to the beginning of everything under a reply. If you can find that, you can do a .split() to return only the reply.



Example Email:



Yes!


------


To: John Cunningham


From...



Body: etc.



With this e-mail, you can see that the e-mail under the reply starts with "To: ". If all of the e-mails are this way, you can do the following in your script:



current.work_notes ="reply: " + email.body_text.split('To: ')[0] + "\n\n";



Thank you, I hope this helps.


hi Waqas, if you are referring to what I think you are, then you can right click on the Activity bar, choose to Personalise and remove "Sent/Recieved emails" or uncheck "emails"



However, looking at one of our tickets where I know I emailed an update to a ticket yesterday, I can see the emails that were sent from this ticket, but not my reply


i can see my reply has been processed in the work notes


the code we have is pretty much identical to yours, so not sure why I am not seeing the received emails.


I will look into that too