- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 06:07 AM
Hi All,
I have tasked to create a specific type of case when Email is sent to specific email id. I have tried below code but its is not working for me. How do I check recipients email id in Inbound Script
if(email.from.indexOf("police.request@example.com"){
current.case_type = "police_request"
current,state = "10";
current.short_description = email.subject;
current.description = email.body_test;
current.insert();
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 08:29 AM
Hi @The Matrix .
Try below code:
if (email.direct.toLowerCase().indexOf('email@domain.com')>-1)
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 07:22 AM
Hi @The Matrix ,
Try below code
if(email.from.indexOf("police.request@example.com" != -1){
current.case_type = "police_request"
current.state = "10";
current.short_description = email.subject;
current.description = email.body_test;
current.insert();
}
Also there is a typo (comma) in your code.
current,state = "10";
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 08:29 AM
Hi @The Matrix .
Try below code:
if (email.direct.toLowerCase().indexOf('email@domain.com')>-1)
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda