Question
Verizon Data Services
IN
Last activity: 30 Jan 2020 1:34 EST
Adding additional attributes in Request Header while sending outbound correspondence
How to add new attributes while sending correspondence from pega.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Can you tell us what do you mean by Request headers on Sending correspondence.
Additional attributes on sending correspondence, you meant email headers like To, From, Subject, CC, BCC etc.. ?
Verizon Data Services
IN
Hi Harish,
Yes I mean like To, From etc. Open any service email rule in pega and go to request tab to see the request header mappings .
Pegasystems Inc.
US
Service Email rules are to manage incoming email. The Request tab is used to declare any request headers from incoming email messages and maps it to clipboard properties. Based on the incoming email message from the external system, you can add header fields by their name for further mapping.
As your query is about Outgoing correspondence, Can I know what are the additional headers are you looking to set apart from the standard (mandatory) ones like From, To, Cc, Subject which are sent as a parameters for utility activities for sending an email from Pega.
Verizon Data Services
IN
I have a rest api which is sending an outbound correspondence from pega to certain email accounts. We have some email listeners which are are pointing to these email acounts . As a part of the request payload I am receiving some fields and I want to send say Email or Name from below in the request header such that when Pega maps it, I can easily get the attributes from service page.
Note: I can extract the contents from email body but since I have to explicitly do it for each and every attribute I am looking for an alternative.
Sample Request Payload:
{
"Name":"Tester",
"Email":" Proprietary information hidden",
"Phone":"1234567890",
"Country":"United States",
}
Pegasystems Inc.
US
I couldn't connect the dots in understanding the entire requirement, though your initial query sounds a little ambiguous but simpler to understand.
In terms of Incoming email:- You may use the Service-Email Request tab to declare mail headers (from email source) and map to clipboard property.
For outgoing email:- As Pega uses certain utilities & inbuilt functions like pxSendEmail to send an email, there is limited support to add additional headers apart from the standard ones we discussed before.
For incoming REST & outing REST requests, it's the again request/response tab's Header section to include new headers to read/write.
Verizon Data Services
IN
Let me explain the complete structure :
1) There is a rest service in pega with accepts the below request payload:
{
"Name":"Tester",
"Email":" Proprietary information hidden",
"Phone":"1234567890",
"Country":"United States"
}
2) When pega receives the request it sends an email to different mail boxes with the payload it received in the correspondence.
3) There is a particular email listener which listens to one of the email account which is being used in point no 2.
4) On receiving the email the email listener create a new interaction case depending on the email subject which it received from point 3
5) By default I see that pega is mapping fields like To,CC,From,Sender Name,Subject etc. in request header to ServicePage.pyInboundEmail page
6) I want a way to map some additional attributes which I received in the request payload , so that I get it directly in pyInboundEmail page.
I hope you can connect the dots now.
Wipro
IN
Hi Nikhil,
If the extra attributes are coming as part of body of email then you can access them by ServicePage.pyInbountEmail.pyBody . You can give Prop=Value kind of string in the mail body. Later you can read the value of this property in your service activity. ServicePage.pyInbountEmail page is prepared internally by PEGA code and I doubt they will capture anything but standard email attributes. Hope this this helps.
Rajesh
Pegasystems Inc.
US
I get it now.
Any custom or additional email headers present in the raw email(.eml) on an incoming email to Pega via EmailListener -> Service-Email can be read. Provided the header is present in the email source, we can use request Tab by defining the exact <HEADER_NAME> and mapping to clipboard pyInboundEmail (Embed-Services-InboundEmailInfo) existing or new property.
In your scenario, the incoming email processed by thru Email Listener is sent by Pega itself through correspondence. Hence there is limited support to add additional headers apart from the standard ones we discussed before. If you can set the custom attributes in correspondence (email body) itself with name-value pairs like prop=value, then you can parse the pyInbountEmail.pyBody value and read it in your service-email service activity.
Hope this helps!
Verizon Data Services
IN
If you read my initial post I have mentioned clearly that I am extracting it from the body of the email but I am looking for an alternative and i.e. where I thought of using headers . I believe changing the sendemail function might work not sure though ,will change and let you know.