Email Client Template - Add ALL previous comments/activities to responses/replies.

Nathan Okh
Mega Sage

Hello we are trying to attach a list of all comments on an incident to a reply from an incident using the Reply/Email button. 

I've already modified the Email Client Template, and I can get the LAST comment attached but we need a list of all the activity/comments added to the email response.

find_real_file.png

find_real_file.png

I will mark helpful for whoever helps out getting closer to the answers.

3 REPLIES 3

Ian Mildon
Tera Guru

You should be able to do so by creating an email script, similar to this example:

  (function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
  /* Optional EmailOutbound */
  email, /* Optional GlideRecord */ email_action,
  /* Optional GlideRecord */
  event) {

  template.print(current.comments.getJournalEntry(-1));

})(current, template, email, email_action, event);

Then on your template add the call to the email script, similar to this (but edit to call your new script):

${mail_script:insert_original_email_message}

Awesome I think thats getting me closer... So it looks like its added whats been added as a 
"comment" is it possible to add the "Email received" instead? 

find_real_file.png

find_real_file.png

Or should I just add the emails being received into the comments and that would do that?

SwatiYeginati
Tera Expert

Were you able to figure this out? I want to add "email sent" to the email client. We add "email received" as comments.