Is working with multiple E-Mail Domains in one Instance possible?

benjamin_exner
Tera Expert

Hi Community,

 

I'm new to the ServiceNow product and this community and hope someone can help me with the following.

 

Is it possible to answer case 1 for an end-user/customer with service@domainA.com and for case 2 we use service@domainB.com?

 

I looked at a lot of articles related to SMTP, outbound and inbound but i did not see an answer to exactly this question (or maybe i overlooked it).

 

Roughly explained our Set-Up:

We are on Patch Utah

Products we use are CSM and ITSM

The System is being used and Set-Up

 

Why do we need this? Our Company has different Business Units / Brands and for the end-user/customer, we want to separate the communication by domain. We currently only have One Brand on the Instance but we want to add another and stumbled over this topic.

 

I hope the description is clear and if you need further information, just ask and let me know.

 

BR

Benjamin

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

HI, in each notification you have the option to set 'From' and 'Reply to' via the 'What it will contain tab'; Although this would require sperate notifications for each message/email domain combination.

TonyChatfield1_0-1688588795859.png

 

If you wish to maintain only 1 notification message across the platform, you could also deliver this via a notification email script and use javascript to set From/Reply To values in your emails

Scripting for email notifications (servicenow.com) - check the example scripts.

- I use notification email scripts in 1 platform I support for 10+ and growing separate email domains.

 

As notification email scripts have access to the 'current' object and most records have a relationship to company (If your user/email domain records are separated by company?), then I would consider adding from/reply to string fields to your company records and then utilizing these in any notification script as this would minimize admin overhead, and give you flexibility if you need to change existing values or add new email domains.

//Depending on use\platform configuration there are many ways to deliver this type of solution and you might need to dot.walk\test mapping for a number of paths to deliver a single script for all scenarios.
//A basic example for possible 'reply to' solution.

var defaultReplyTo = 'someone@somewhere.com';

if(typeof current.company.u_reply_to != 'undefined') {
defaultReplyTo = current.company.u_reply_to;
} else if(typeof current.task.company.u_reply_to != 'undefined') {
defaultReplyTo = current.task.company.u_reply_to;
} else if (typeof current.opened_for.company.u_reply_to != 'undefined') {
defaultReplyTo = current.opened_for.company.u_reply_to;
}
email.setFrom(defaultReplyTo);

 

View solution in original post

5 REPLIES 5

Tony Chatfield1
Kilo Patron

Hi, unfortunately your question\requirement is not clear, perhaps you could update with more specific details?
If you are looking for a solution for inbound email, normal practice is to configure a local mailbox IE service@domainA.com to forward to your SNC instance email address
For outbound messages you can set reply to address per notification, or can use a notification email script to set dynamically.

Hi @Tony Chatfield1 ,

 

I'm happy to give more details.

 

My question is specifically related to outbound emails. ServiceNow is only able to handle one active SMTP so if I configure this with service@domainA.com the only thing we can do is send an e-mail like this:

 

service-desk@domainA.com

service-support@domainA.com

 

This is fine, but what we also want to do is:

 

service-desk@domainB.com

 

In my understanding this would require an additional SMTP or am I wrong? The configuration may be doable but nobody on our side knows about it.

 

I can just state that we had two Meetings related to this topic and nobody knows how to solve it.

 

I hope that gives more insights, but if not, I am always happy to assist with more specific details.

 

BR

Benjamin

Tony Chatfield1
Kilo Patron

HI, in each notification you have the option to set 'From' and 'Reply to' via the 'What it will contain tab'; Although this would require sperate notifications for each message/email domain combination.

TonyChatfield1_0-1688588795859.png

 

If you wish to maintain only 1 notification message across the platform, you could also deliver this via a notification email script and use javascript to set From/Reply To values in your emails

Scripting for email notifications (servicenow.com) - check the example scripts.

- I use notification email scripts in 1 platform I support for 10+ and growing separate email domains.

 

As notification email scripts have access to the 'current' object and most records have a relationship to company (If your user/email domain records are separated by company?), then I would consider adding from/reply to string fields to your company records and then utilizing these in any notification script as this would minimize admin overhead, and give you flexibility if you need to change existing values or add new email domains.

//Depending on use\platform configuration there are many ways to deliver this type of solution and you might need to dot.walk\test mapping for a number of paths to deliver a single script for all scenarios.
//A basic example for possible 'reply to' solution.

var defaultReplyTo = 'someone@somewhere.com';

if(typeof current.company.u_reply_to != 'undefined') {
defaultReplyTo = current.company.u_reply_to;
} else if(typeof current.task.company.u_reply_to != 'undefined') {
defaultReplyTo = current.task.company.u_reply_to;
} else if (typeof current.opened_for.company.u_reply_to != 'undefined') {
defaultReplyTo = current.opened_for.company.u_reply_to;
}
email.setFrom(defaultReplyTo);

 

benjamin_exner
Tera Expert

Hi @Tony Chatfield1 ,

 

sorry for the late reply, we had two issues that I had to take care of first.

 

Thank you very much for the reply, I would say, this is exactly what I was looking for and it helps a lot, thank you.

Just one final question as I started testing this and have one question.

If I have an SMTP with:

service@domainA.com

 

Which can send E-Mails also for:

servicedesk@domainA.com

service@domainB.com

 

I was checking service@domainA.com and servicedesk@domainA.com with your example but technically the emails are all sent from service@domainA.com. Do you know if this can be changed as well? I believe this is something the Devs of our Company have to figure out right because if this stays, the sending is like something I just read about and this is called spoofing or am I wrong?

 

Best Regards

Benjamin