Questions on notification implementation

Rain Vaine
Kilo Sage

Hello experts,

If I want to set an automatic reply every time a 'new' email is received in the instance, what is the optimal approah?
Method 1: I am thinking of just using the notification. I am thinking of setting the 'when' tab to inserted and received type is 'new'.

 

When I check on who will receive tab, I am not sure on what to set:

RainVaine_1-1728362198907.png

 

Method 2: Create an inbound email action that will trigger an event that will send the notification.
This has email.origemail that will get the senders email.

Is it much better to use method 2?
Is it ever possible to use method 1?

Regards,
Vaine



3 REPLIES 3

Sanjay191
Tera Sage

Hello @Rain Vaine 
Yes it will better to use the method 2 and it will otimal approach  for you.
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up. 

Thank You

Hello,
I tried implementing the event and notification approach but I am encountering a problem. The situation is that when the new email is received, it will not create an incident, but instead create an event that will trigger the notification. The problem is since no incident is created, the event is not being processed and shows an error. Is there any possible work around here?

Regards,
Vaine

Hitoshi Ozawa
Giga Sage
Giga Sage

I haven't tested it but how about using a business rule? 

table: sys_email

Active: checked

Advanced: checked

When: after

Insert: checked

Filter Conditions:

Type is received

Received type is New

Script:

    if (current.type == "received") {
        var replyBody = "autoreply email message.";

        var replyEmail = new GlideEmailOutbound();
        replyEmail.setSubject("Re: " + current.subject);
        replyEmail.setFrom("autoreply@servicenow.com"); // Replace with email to use to reply
        replyEmail.setTo(current.origemail);
        replyEmail.setBody(replyBody);
        replyEmail.send();