Include previous email conversations to outbound emails

trekonen
Kilo Explorer

Hi,

has anyone developed a way to include a previous email conversation to outbound emails, or a way to reply to a received email including the original message?

No need for that in standard notifications, but would be a nice feature to have a way of replying to a email received from a sender which is attached to a Incident, and including the previous message.

Any way of building a Client Template to query the sys_email table for the previous message, or something similar?

Our old ITSM tool had the possibility to view any individual emails attached to an Incident, Change or whatever, and replying to any of those including the previous message contents is something our large user group is used to, and i'm trying to find a way to create something even remotely similar. 🙂

Any thoughts?

3 REPLIES 3

ShaneBrazeal
Tera Contributor

I've done it before where I've printed out all the comments from an incident using the following mail script (sorted A-Z on created):



<mail_script>
var notes = current.comments.getJournalEntry(-1);
var na = notes.split("\n\n");
var i;

for(i = na.length - 1; i >= 0; i--){
template.print(na<i> + "\n\n");
}
</mail_script>


Hi Shane,

  A colleague of mine just tried to use this code and I had to make a small adjustment to make sure that the array was indexed correctly (changing angle brackets to square ones):

<mail_script>
  var notes = current.comments.getJournalEntry(-1);
  var na = notes.split("\n\n");                     
  var i;
 
  for(i = na.length - 1; i >= 0; i--){
    template.print(na[i] + "\n\n");
  }
</mail_script>

trekonen
Kilo Explorer

Thanks Shane!

This approach could work very well, i'll give it a try...