Capture email headers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2011 03:06 PM
Here is a script I wrote to capture email headers and attach it as a related list to incidents:
Table: sys_email
Run: After update
Condition: current.instance.changes() && current.instance.sys_class_name=="incident"
var incID = current.instance;
var incREC = new GlideRecord('u_email_headers');
incREC.initialize();
incREC.u_task = incID;
incREC.u_header = current.headers;
incREC.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2013 06:00 PM
can i put this into an inbound email action.
All new emails are sent straight to a new call stage so i would need the headers to be attached to the new call.
Cheers
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2013 06:11 PM
current.headers in your inbound action should give you this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2013 06:25 PM
sorry - do you mean
current.headers = email.headers?
what i have is below
would i slot this code into there?
var sid = gs.createUser(email.from);
gs.log('email from:' + email.from + ' created user:' + sid);
if ((email.copied.toLowerCase().indexOf('servicedesk@auckland.ac.nz') == -1)
&& (email.copied.toLowerCase().indexOf('studentservicesonline@auckland.ac.nz') == -1)
&& (email.copied.toLowerCase().indexOf('cecilhelp@auckland.ac.nz') == -1)
&& (email.copied.toLowerCase().indexOf('remedy@auckland.ac.nz') == -1)
&& (email.copied.toLowerCase().indexOf('askit@auckland.ac.nz') == -1))
{
// Process as per normal
current.description = "received from: " + email.origemail + " " + "(Cc's): " + email.copied + "\n\n" + email.body_text
current.short_description = "[" + email.direct +"]" + " " +email.subject ;
current.u_requestor = sid;
current.opened_by = sid;
current.contact_type = "email";
current.insert();
} else {
// Sent via CC line... reject.
var userRec = new GlideRecord('sys_user');
if (userRec.get(sid)) {
gs.eventQueue('inbound.copied', userRec, sid, email.subject);
}
}