- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 12:08 PM
Hi all,
This might be a bit basic, but I can't get it to work:
I am trying to tell the inbound action to skip creating an incident if the body of the email contains the word "CLEARED: ".
I am trying something like this:
...
} else if (email.recipients.indexOf('monitoring.network@MyCompany.com') > -1) {
if(email.body.indexOf("CLEARED: ") > -1) {
current.setAbortAction(true);
}
createIncidentNetwork();
gs.log('HBS, createNetworkIncident');
}
Using if(!email.body.indexOf("CLEARED: ") > -1) yields: confusing use of !
How do I tell the script to stop running?
How do I fix this if condition?
Thanks,
Harel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:05 AM
Hi,
I would try adding an email filter instead of using the inbound action.
The Email Filter plugin must be activated to work.
Create a new Filter and add the condition "Body contains cleared: "
Under filter actions you can mark is as ignored or junk (for testing I use junk)
Hope this helped.
Darla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:17 AM
Hi Julian,
Thanks; it is definitely CLEARED with upper case, though.
Harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:05 AM
Hi,
I would try adding an email filter instead of using the inbound action.
The Email Filter plugin must be activated to work.
Create a new Filter and add the condition "Body contains cleared: "
Under filter actions you can mark is as ignored or junk (for testing I use junk)
Hope this helped.
Darla
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:16 AM
Like the idea, but not sure if that would work as the original message is also checking against a specific email address before it checks for the wording.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:20 AM
The filter can add multiple conditions like:
Recipient is monitoring.network@mycompany.com and other conditions.
This is what I have done to minimize our spam tickets:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-13-2015 08:37 AM
Hi Darlene,
This is working, thanks.
I added a filter, as you suggested, to ignore email messages which contain the word CLEARED in the body of the mail.
Harel