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.
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.
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.
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.
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.
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.