Inbound email action - call script include in condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 03:16 PM
Hi,
Im not able to include multiple email addresses in the condition field for the inbound email action script due to length.
I need some guidance on creating a script include and calling it in the inbound action condition.
script include:
function checkEmail(email) {
var e1 = email.receipients.toLowerCase().indexOf('****') >= 0;
var e2 = email.receipients.toLowerCase().indexOf('******') >= 0;
var e3 = email.receipients.toLowerCase().indexOf('*******') >= 0;
var e4 = email.receipients.toLowerCase().indexOf('*******') >= 0;
var e5 = email.receipients.toLowerCase().indexOf('**********') >= 0;
return e1 || e2 || e3 || e4 || e5;
}
Thanks,
A

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2018 03:27 PM
You could have done it in the inbound script itself
var rec = email.receipients.toLowerCase();
if (rec.indexOf('****')>-1 || rec.indexOf('******')>-1 || rec.indexOf('*******')>-1 || rec.indexOf('*******')>-1 || rec.indexOf('**********')>-1)
{
Your inbound script
}
if you want to do it in script include
checkEmail: function(email) {
var e1 = email.receipients.toLowerCase().indexOf('****');
var e2 = email.receipients.toLowerCase().indexOf('******');
var e3 = email.receipients.toLowerCase().indexOf('*******');
var e4 = email.receipients.toLowerCase().indexOf('*******');
var e5 = email.receipients.toLowerCase().indexOf('**********');
if (e1>-1 || e2>-1 || e3> -1 || e4>-1 || e5>-1)
return 'return true or false as required';
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2018 02:22 AM
Thanks for your assistance. I tried what you suggested to include the if statement in the inbound script but the inbound action get skipped.
thanks,
A

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2018 02:45 AM
Hi Adam,
There is a typo in your script. You need to replace email.receipients with email.recipents.
Hope this helps.
Regards
Ujjawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2018 08:31 AM
Thanks for spoting that typo.
Not sure what im doing wrong as the inbound action is still getting skipped.
Any Ideas?
Thanks,
A