Inbound email for Interaction
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2020 02:24 AM
Hi All,
I need to have an inbound email action for creation of interaction when a user sends mail to a particular mail id.
Also the following requirement:
- Email generates interaction with transfers subject as short description and email body as description
- User record is pulled from user table if email address is from @abc or @xyz
- If from unknown email source, user is "caller", and email address is added to the watchlist.
Please help on how can we achieve this.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2020 02:35 AM
Hi,
Please go through the below link and video in that link that might helps you
Kindly mark it correct and helpful.
Thanks,
Priyanka

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2020 02:58 AM
Hi Archana,
Go to Inbound email action>
specify mail id for creation of interaction when a user sends mail to a particular mail id.
when to run>from
In action tab you have script section where you have method
runAction(current, event, email, logger, classifier) ;
using email you can access attribute of email like to,recipients,body etc.
and set values according to requirement.
Please mark if that helps you!!!.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2020 03:19 AM
Hi,
When user sent an email to particular mail id, mailbox should auto forward mails to Servicenow.
To create an interaction in servicenow , Create an inbound action on interaction table with 'New' type. Update the execution order field to lowest order, so that it runs first. Use conditions, to check the email from address.
As per the OOB, description and watch list fields are not available on interaction. If you have added those fields manually, update the field names in the below script.
Use below script or something similar:
if(email.from)
{
var gr= new GlideRecord('sys_user');
gr.addQuery('email',email.from);
gr.query();
if(gr.next())
current.opened_for = gr.sys_id; //if the email from address available in Servicenow, get the sys_id and set opened_for
else
{
current.opened_for=<<guest id>>;
current.<<watch_list field name>>= email.from; //update the mail address in watchlist
}
}
current.<<additional comments>> = "received from: " + email.origemail + "\n\n" + email.body_text; //update the field name
current.short_description = email.subject;
current.<<description>>=email.body_text; //update the description field name
current.type ='<<type value>>'; //update the type value
current.insert();
If I have answered your question, please mark my response as correct and/or helpful.
Thanks,
Suseela P.