Email not getting sent if the 'to' address is missing

johannes5
Giga Expert

Hi Guys,

I have the following situation: I am sending an email to a group outside the notification record in ServiceNow. I could not dot walk into this group I had to script to get to it, then read the group to get all its members and send an email to each member in the group. I used a notification email script and I am cc'ing the members i.e. when the email is sent the members appear under Copied (cc) in ServiceNow and in Outlook they appear under 'cc'. The problem I am running into is it seems as if SN does not send a notification if the 'to' field is not populated. In other words if you don't specify inside the email notification who the email recipients are then no email gets sent. In my case I cannot specify who the email recipient is because its the assignment group that is outside the email notification record, I could not even dot walk to it I had gliderecord to it which is why I have to cc it. If I populate the work notes list and specify the work notes list as email recipient in the notification record, the email is getting sent to the work notes list and to the members within my assignment group however if the work notes list is empty no email gets sent which makes me to come to the conclusion that if the recipient is not specified within the email notification record, the system ignores the recipients in the cc filed. Do you guys know how can I overcome this situation? I would like the emails to be sent to cc recipients irrespective of whether the 'to' recipients are there or not.

Please advise.

Thanks,

Johannes

1 ACCEPTED SOLUTION

lokeshreddy23
Giga Expert

Hi Johannes,



Instead handling the logic to handle to which group (or members) you need to send emails to in Email notification, In the business rule that triggers the event, pass the sys id of the group to whom you want to send in event parm. and you can use the event parm as recipient



for example, if the email is triggered through event abc, and sys id of by group to whom i want to send is "877ghh234ghg32h4"



the event triggred in business rule should look like



gs.eventQueue("abc", current, "This is parm1,you can place your group sysid here", " This is parm 2, you can place your group sys id here also");




and in the email (Eureka version) you can can select which ever parm you want email to be sent to




eventparam.png


for further study about event queue usage


GlideSystem - ServiceNow Wiki



View solution in original post

4 REPLIES 4

lokeshreddy23
Giga Expert

Hi Johannes,



Instead handling the logic to handle to which group (or members) you need to send emails to in Email notification, In the business rule that triggers the event, pass the sys id of the group to whom you want to send in event parm. and you can use the event parm as recipient



for example, if the email is triggered through event abc, and sys id of by group to whom i want to send is "877ghh234ghg32h4"



the event triggred in business rule should look like



gs.eventQueue("abc", current, "This is parm1,you can place your group sysid here", " This is parm 2, you can place your group sys id here also");




and in the email (Eureka version) you can can select which ever parm you want email to be sent to




eventparam.png


for further study about event queue usage


GlideSystem - ServiceNow Wiki



Thank you very much Lokeswar, your answer was spot on and it was very easy to implement.


Kalaiarasan Pus
Giga Sage

The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Scripting for Email Notifications
     
   


Visit http://docs.servicenow.com for the latest product documentation