Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Define Multiple Outbound Email Accounts according to Department

F_bio Gon_alves
Tera Expert

Hi SNC,

As anyone managed to successfully set multiple Outbound Email Accounts according to Department?

For example, for a given email notification sent to user A regarding Facilities Request closure, tthe outbound email be presented as 'facilities@companyA.com'; and for an email notification sent to user B regarding Marketing Request closure, the outbound email be presented as 'marketing@companyB.com'?

Thanks in advance,

Fábio Gonçalves

1 ACCEPTED SOLUTION

Hi Fabio,



I am not sure on your intent of having GR query on sysevent_email_action table, you have to create mail scripts under the 'Notification mail scripts' module



find_real_file.png



you have to use the email.setFrom in the mail script and use the email script in the notification as ${mail_script:<mail script name>}



http://wiki.servicenow.com/index.php?title=Scripting_for_Email_Notifications#gsc.tab=0


View solution in original post

9 REPLIES 9

You can include the mail script in the "Message HTML" field under "what it contains " section.




Let me know if you cannot figure that out, i can provide you with an example screenshot


Hi Karthik,



I can't make it work.


This iswhat I have done:



1. I created an Email Script called "Set Email From Finance Department" with the script "email.setFrom('finance@coehub.com');"


Capture1.PNG




2. I included that Email Script in the "Message HTML" fileld under "what it will contain" section", like you said;



Capture.PNG



But unfortunately it does not work. The email notification is sent, but with the default "From" field, which is "Help Desk" and an "Email script render error: email script [ <Set Email From Finance Department> ] does not exist " error message in the body of the Email.




Regards,



Fábio Gonçalves


Hi Fabio,



Did you get past the error, you don't need the <> signs while including the script.



it should be ${mail_script:Set Email From Finance Department}


Hi Karthik,



Thanks for your help once again.
With your latest update I was able to get past the error yes.




Thanks a lot.



Regards,



Fábio Gonçalves


Nandan Raj
Kilo Contributor

Hi guys,

I am also dealing with same kind of requirement.

My question is that we can set email from as example@example.com using this method.

But We will be need to configure this mailid example@example.com to servicenow?

OtherWise how can SNOW access or send email from random mail id without any configuration?

Please correct me If i misunderstood something

Thanks