Facing issue in mapping hr service through inbound actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 05:20 AM
Hi,
I was having a key word when for e,g anr has used it need to map general inquiry hr service.
For e.g when subject contains requesting charan it was mapping to general inquiry hr service as in the name charan the letters anr has been used.
condition:
email.subject.toLowerCase().indexOf('anr')>-1
How to make only when anr is used in subject then only it has to map for general inquiry hr service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 05:34 AM
It depends on your setup. Are you handling all emails the same and are you checking inside the script for the subject, you will need to use 'subject contains' in an inbound email flows or inbound email action. If you are separating this one from the others, you will need to do the same, but then in the trigger condition.
Assuming you are doing this through inbound email actions and not a flow and assuming you are doing this generally for all HR cases and just this one needs a different field filled:
(function processEmail(email, email_action, event) {
// Get the subject of the email
var subject = email.subject.toLowerCase();
if (subject.includes('anr')) {
hrCase.hr_service = 'YOUR_GENERAL_INQUIRY_SERVICE_ID';
and the rest of your logic
})(email, email_action, event);
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark