Inbound action email.from contains example.com

sailor_moon
Tera Contributor

Hi,

I'm working on inbound action wherein I need to set the condition that the email should contains example.com

Has anyone had any luck with this?

 

 

 

1 ACCEPTED SOLUTION

Karan Chhabra6
Mega Sage
Mega Sage

Hi @sailor_moon ,

 

You can use this condition:

email.from.indexOf("example.com") > -1

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

View solution in original post

3 REPLIES 3

Karan Chhabra6
Mega Sage
Mega Sage

Hi @sailor_moon ,

 

You can use this condition:

email.from.indexOf("example.com") > -1

 

If my answer has helped with your question, please mark it as correct and helpful

 

Thanks!

Thank you!

Prithvi_b
Tera Guru

Hi @sailor_moon ,

You can go through https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0867711, link.

And in the action part, you can give the condition.

 

Eg:  

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {

    if(      
        email.origemail.toLowerCase().indexOf('servicedesk@test.ok.gov') != -1 ||
        email.origemail.toLowerCase().indexOf('prithv@test.com') != -1 )
{
 
 current.opened_for =gs.getUserID();
        current.short_description = email.subject;
        current.work_notes =email.body_text;
        current.state='new';
        current.type ='chat';
        current.insert();
        }
 
 
 
Thankyou,
prithvi