Setting from and reply to address based on email.to

Dubz
Mega Sage

Hi All,

My organisation is a group of companies, the retails elements need to have different branding on their customer facing email notifications. I've got the incident updated etc notifications working dynamically so that, depending on customer or assignment group a different from and reply to address is set and a different logo is put in the signature.

What i'm trying to do now is change the incident created for me notification. I'm trying to avoid creating a different notification for every retail company but the only other detail i can use is the address the email is sent to. i can script based on email.to in the advanced section of the when to send tab but email.to isn't available in the mail scripts used in the body of an email. Does anyone know of a way i can pass this information to a mail script or some other way i can identify which address the email was sent to in a mail script?

1 ACCEPTED SOLUTION

Dave Smith1
ServiceNow Employee
ServiceNow Employee

If it's an email notification, you should be able to dot-walk to a field containing the "from" address (or to: address) and pop that in the form fields - so one notification can dynamically fetch the values at run-time.



How you store the from/to fields against the record is going to be another matter, mind.


View solution in original post

3 REPLIES 3

Dave Smith1
ServiceNow Employee
ServiceNow Employee

If it's an email notification, you should be able to dot-walk to a field containing the "from" address (or to: address) and pop that in the form fields - so one notification can dynamically fetch the values at run-time.



How you store the from/to fields against the record is going to be another matter, mind.


Hi Dave,



Thanks for the response. I have all the email addresses that raise tickets and the companies they're associated with stored in the custom table so accessing them isn't a problem. I actually just tested and realised i can do email.setFrom() from the advanced script condition on the 'when to send' tab, didn't realise i could do that I probably should have tested that before i resorted to the community!


Dave Smith1
ServiceNow Employee
ServiceNow Employee

didn't realise i could do that I probably should have tested that before i resorted to the community!


Ah, it happens!   Others will probably find this snippet useful when searching, so no problems with asking questions - glad to have been of help!