- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 11:13 AM - edited 03-20-2024 11:28 AM
I've created an inbound action to fire for new emails that contain certain keywords in the subject or body. It's working correctly for words included in the subject, but it's not firing off the response email when words are in the body. What am I missing??
(function executeRule(current, previous) {
var keywords = ['attack', 'bruteforce', 'brute-force', 'brute force', 'click', 'infect', 'malware', 'phish', 'trojan', 'virus'];
var subject = current.subject.toLowerCase();
var htmlEmail = current.body_text.toLowerCase();
var textEmail = current.body_html.toLowerCase();
var containsKeyword = false;
for (var i = 0; i < keywords.length; i++) {
if (subject.includes(keywords[i]) || htmlEmail.includes(keywords[i]) || textEmail.includes(keywords[i])) {
containsKeyword = true;
break;
}
}
if (containsKeyword) {
gs.eventQueue('notify.caller.from.incident', current, '', '');
}
}
)
(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 10:02 AM
Found the answer. Looks like I was drilling down too far for the rule to operate correctly. I only needed to refer to
current.body
with no _text or _html. Scraper is working correctly now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 10:02 AM
Found the answer. Looks like I was drilling down too far for the rule to operate correctly. I only needed to refer to
current.body
with no _text or _html. Scraper is working correctly now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 12:23 PM - edited 01-15-2025 12:31 PM
I ran into a similar issue when setting up inbound actions, and it turned out the problem was with how the trigger was configured to check the body text. In my case, it was only scanning the subject by default, so I had to adjust the conditions to also look through the email body. Once I made sure it was set up to scan both, everything worked perfectly! I also used a little automation on my end to help with form submissions, and I found that submit form with puppeteer really helped automate a part of the process for me. It made everything smoother and less manual.