Skip to main content

Get Email Headers action

Use the Get Email Headers action in inbound and in-queue email flows to get the email headers in a variable of the JSON data type.

This action makes the MIME Message-ID and other email header fields accessible, allowing you to build flows that process emails based on context. For example, by adding email header fields to participant data, you can attach contextual metadata to email interactions, enabling dynamic routing decisions and providing agents with relevant header information (such as priority or importance) for improved context during interaction handling.

Notes:
  • To retrieve a specific set of email headers, configure the Get Email Headers action with an optional input of up to five header names.
  • The Get Email Headers action retrieves only the headers from the first email in a threaded conversation.
FieldDescription
Name fieldType a distinctive name for the action. The label you enter here becomes the action’s name displayed in the task sequence.
Email Header Names

Specify the email headers to retrieve. 

  • To return all email headers, select All Email Headers, or select literal and leave the string collection empty. You can also use the expression MakeEmptyList(ToString(NOT_SET)).
  • To add a custom string collection of up to five header name strings for the Get Email Headers action to get, select literal and click String. You can also use an expression. For example, to add a string collection that contains the strings “Message-ID”, “Subject”, “Authentication-Results”, “Content-Language”, and “Return-Path” for email header names, use the expression MakeList("Message-ID", "Subject", "Authentication-Results", "Content-Language", "Return-Path").
Email Headers Result

Type a distinctive name for the variable of the JSON data type that the action uses to return the email headers in.

Failure Outputs

These outputs allow the flow author to map the results of any resulting errorType and errorMessage variables when the Get Email Headers action takes the failure path.

  • errorType: A nonempty string that contains the type or category of the error.
  • errorMessage: A non-localized failure message. The string may be empty or NOT_SET.

Note: Hover over the information icon next to errorType to display the list of allowable errorType values.

Genesys Cloud checks failure path scenarios and if none of them are met, Genesys Cloud retrieves the email headers. You can use the following errorType values:

  • ActionInvocationLimitExceeded: If a flow has successfully run the Get Email Headers action five times, any subsequent invocations of the action take the failure path.
  • GeneralError: If there is a general error when retrieving the email headers, the Get Email Headers action takes the failure path.
  • NoEmailHeadersExist: If no email headers exist, the Get Email Headers action takes the failure path.
  • EmailHeaderNamesCollectionItemLimitExceeded: If the input string collection in the Email Header Names field contains more than five items (as a string expression), the Get Email Headers action takes the failure path.