Parsing Email Headers Help

Reich1
Kilo Explorer

Hi SNOW Gurus!

 

got a question here. How do i parse the email headers to create an inbound reply action? I need to create an inbound reply action that is forwarded from a mailbox. But for some reason its not getting the original email sender.

 

what happen is when John Smith emails FWDemail@servicenow.com and it hits the x@service-now.com the userID of the email is FWDemail@servicenow.com and hence the reply email does not get sent.

 

I look at the email headers and i can see the original email where it came from as

 

X-Original-From:John Smith <jsmith@x.com>

Reply-To: John Smith<jsmit@x.com>

 

how can i parse this and set it as the user id? i tried the field values in the servicenow docs and i still cant get the user id. any help will be appreciated. 

 

if(email.header.Reply-To!=undefined){

current.user_id=email.header.reply-to;}

3 REPLIES 3

Matt Saxton - G
Kilo Guru

Hi Reich,

 

Check out 

email.origemail

I think this is what you are looking for the original email sender.

 

https://docs.servicenow.com/bundle/kingston-servicenow-platform/page/administer/notification/reference/r_InboundEmailActionExamples.html

Hi

 

thanks for the reply so should i put in the reply inbound action script as

 

email.origemail = user_id? 

it's not the ID it's going to be the email address from the original sender.