With this integration you can send all your email interactions to Pega. This will be sent real time, so with every email sent, or link clicked, you will see this directly in your Pega application. This integration is based on the REST API integration with Basic Authentication.



Install the app

In the Deployteq Store you can install the Pega app yourself. 


Install step 1

With the installation of the app, you will be asked for some information of your Pega account.

  • Endpoint of the API
    • This is the REST API url which Deployteq will push the interactions to.
  • Username and password
    • This information will be used for the authentication of the endpoint. 


Endpoint en credentials

The username & password for basic authentication can be requested with your contact person at Pega. This isn't a generic Pega API and will be configured at request.

Install step 2

In the second step you can check which activities you want to be sent to the API: 

Install step 3

The last step is the usual financial step. Here you can choose at which interval you want invoices and which PO number need to be used in the interface. When you complete this step the interactions will be send immediately from that point on. 

Finished installation

With the completion of the last step all interactions from that point on will be sent to Pega. This includes open, clicks, etc. in older emails.

Variables Pega

The variables `UniqueOfferId` and `InteractionId` can be added to your email templates to use the information correctly on the side of Pega. These variables can be added as manual fields. For more information on how to add variables to emails, you can check 1.6. Personalizing emails

When you have added the variables you can also add a default, when the variable is not given. Normally the contents triggered by Pega will have this information in the trigger which you can then use for the sending of the specific mail. In the mapping of the webhook you can map these fields to the same environment variables as you have added to the email.

This is an example of the HTML you can use in the meta-data of the email:

Example with environment variables

<!doctype html>
<html lang="nl" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta name="UniqueOfferId" content="{{manual field='UniqueOfferId' default='The default UniqueOfferId'}}" />
<meta name="InteractionId" content="{{manual field='InteractionId' default='The default InteractionId'}}" />
<title>e-Village Example</title>
.........

Data exchange

For every activity in the all emails send from your brand, Deployteq will send a JSON message to Pega. In case of a bulk send, all personal broadcasts will be sent separately to Pega. All calls have partly the same details and every activity has some extra details. For example, a broadcast has all the broadcast details and with an open, Deployteq can add browser details. 

These are the activities we have in Deployteq;

  • broadcasts
  • opens
  • clicks: clicks & short_links
  • bounces
  • complaints
  • unsubscribes
  • conversions

Broadcast (basic information about the send email)

With a broadcast, these details are sent:

FieldnameDescriptionexample
*uuidUnique ID for each message, this is unique per activity (This UUID can't be regenerated afterwards)21f37d1f-3525-4ebf-8142-74773dc7d9cd
*metricEmail activity (broadcasts, opens, clicks, short_links, bounces, complaints, unsubscribes, conversions)broadcasts
*metric_timestampActivity timestamp, unique for each activity (Unix timestamp)1562922481
*metric_idThe metric ID is a unique value per activity, only case of a broadcast the metric ID will be "0"0
external_idCustomer Externalid194076
customer_email_addressCustomer email addressa.vanderkleij@deployteq.com 
email_addressEmail address to which the mail is actually senta.vanderkleij@deployteq.com
email_domainDomain of the email addressteamitg.com
customer_idDeployteq customer unique id, this ID is unique per brand.64561902
portal_idportal ID which us unique per Deployteq client1
brand_idBrandid for the brand within your Deployteq portal (unique per portal)3
broadcast_idUnique broadcastid (unique per portal)2347
broadcast_typeMAIL and maybe SMS or PUSH in the futureMAIL
broadcast_event_typeType of broadcast; QUICKMAIL, SINGLEMAIL, CAMPAIGNMAILQUICKMAIL
sub_typeQUICKMAIL, QUICKSMS, SINGLEMAIL, SINGLESMS, CAMPAIGNMAIL, SMARTRUN, SPLITRUNQUICKMAIL
campaign_idUnique campaignid (unique per brand)22
campaign_nameName of the campaign in DeployteqNew customer journey
campaign_object_idCamaign object id from which the broadcast was sent1
content_idContentid for the used email content in Deployteq4
content_nameName of the email content in DeployteqM1 Introducing Deployteq
subjectSubject of the broadcast Welcome!
mailing_typeMailingtype, this could be an value the Deployteq administrator added to the settingsService
test_mailingBoolean if the broadcast is marked as a test mailingfalse
email_address_overrideBoolean if the override to an alternative receiver is set. customer_email_address will tell to which customer the mail would have been sent and email_address will tell to which address the mail is actually sent.false
broadcast_timestampUnix timestamp of when the broadcast is sent out1562922481
**broadcast_manual_options

Name- value pairs of manual variabels which has been set for the broadcast. In this case the manual options will contain the Pega required fields.


{
"UniqueOfferId": "/Service/Survey/Introduction_evillage",
"InteractionId": "64057021488587867"
}

Additional remarks

* The UUID and Metric fields are unique per message, not per activity or broadcast
** Manual options can be added to the email content, `UniqueOfferId` and `InteractionId` are mandatory for process the data at the Pega side. See variables Pega.

Opens

Next to the basic information this will be send with an open

FieldnameDescriptionexample
uuidUnique ID for each message, this is unique per activity (This UUID can't be regenerated afterwards)172278a9-dc7c-412c-bf94-1764be9fed55
metricEmail activity (broadcasts, opens, clicks, short_links, bounces, complaints, unsubscribes, conversions)opens
metric_timestampActivity timestamp, unique for each activity (Unix timestamp)1562922481
metric_idUnique ID for the metric 232
user_agentUser agent stringMozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; yie11; rv:11.0) like Gecko
osOS based on the openWindows
browserBrowser based on the openInternet explorer
machine_generatedBoolean if the email was opened by a machinefalse

Clicks

In Deployteq we have a click and a short_link, this is a technical detail, which is based on how links are set up in the email or email template. Both is the click activity of a customer.

Next to the basic information, this information is available.

FieldnameDescriptionexample 1Example 2
uuidUnique ID for each message, this is unique per activity (This UUID can't be regenerated afterwards)7dd53d3d-1b0f-4961-a076-b2a8d45e8ef608083017-dd92-4d18-8f22-a555cbb93c10
metricEmail activity (broadcasts, opens, clicks, short_links, bounces, complaints, unsubscribes, conversions), possible values for a click are: clicks or short_linksclicksshort_links
metric_timestampActivity timestamp, unique for each activity (Unix timestamp)15629224811562922481
metric_idUnique ID for the metric 345468
user_agentUser agent stringMozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; yie11; rv:11.0) like GeckoMozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; yie11; rv:11.0) like Gecko
osOS based on the clickWindowsWindows
browserBrowser based on the clickInternet explorerInternet explorer
urlThe URL the customer has clicked on, this can an external URL or Deployteq internal URLhttps://www.deployteq.com/welcome https://www.deployteq.com/welcome
altLink description/ALT tekst in DeployteqOnline surveyOnline survey
google_sourceIf the Google source is set in Deployteq, this field will contain the value. This field will be empty if this value isn't set or embedded in the URL

google_mediumIf the Google medium is set in Deployteq, this field will contain the value. This field will be empty if this value isn't set or embedded in the URL

google_termIf the Google term is set in Deployteq, this field will contain the value. This field will be empty if this value isn't set or embedded in the URL

google_contentIf the Google content is set in Deployteq, this field will contain the value. This field will be empty if this value isn't set or embedded in the URL

google_campaignIf the Google campaign is set in Deployteq, this field will contain the value. This field will be empty if this value isn't set or embedded in the URL

tagsAn array of all the tags that has been configured for the URL

[
"Online Survey",
"Welcome program","2023"
]

[
"Online Survey",
"Welcome program","2023","Website"
]

Bounces

Next to the basic information, this information is available.

FieldnameDescriptionexample
uuidUnique ID for each message, this is unique per activity (This UUID can't be regenerated afterwards)ed0e18a4-bb7d-4fe7-b118-ed2898a3d79d
metricEmail activity (broadcasts, opens, clicks, short_links, bounces, complaints, unsubscribes, conversions)bounces
metric_timestampActivity timestamp, unique for each activity (Unix timestamp)1562922481
metric_idUnique ID for the metric 502
bounce_codeThe bounce code which has been communicated by the email provider5.4.4
bounce_reasonThe bounce reason which has been communicated by the email providerPolicy related
bounce_typeThe type of bounce: HARD or SOFTHARD
bounce_count_hard

The Hard bounce count, when this value is bigger then 0 the customer isn't mailable

1
bounce_count_softThe Soft bounce count, when this value is bigger then 4 the customer isn't mailable. This value can be reset if a customer opens/clicks in a previous received email or when the email address is changed within Deployteq.0

Complaints

Next to the basic information, this information is available.

FieldnameDescriptionexample
uuidUnique ID for each message, this is unique per activity (This UUID can't be regenerated afterwards)32f9964e-f78b-47d0-876c-38fc634a9816
metricEmail activity (broadcasts, opens, clicks, short_links, bounces, complaints, unsubscribes, conversions)complaints
metric_timestampActivity timestamp, unique for each activity (Unix timestamp)1562922481
metric_idUnique ID for the metric 699
complaintsThe complaint count1

Unsubscribes

Next to the basic information, this information is available.

FieldnameDescriptionexample
uuidUnique ID for each message, this is unique per activity (This UUID can't be regenerated afterwards)370ffb41-5c3a-45d6-a254-e24f6cde57b8
metricEmail activity (broadcasts, opens, clicks, short_links, bounces, complaints, unsubscribes, conversions)unsubscribes
metric_timestampActivity timestamp, unique for each activity (Unix timestamp)1562922481
metric_idUnique ID for the metric 725

JSON examples

These are some JSON examples on what the request will look like. Please note that the name and value of the manual fields will vary. See the variables Pega for the details

Broadcast
[
    {
        "portal_id": 1746,
        "portal_name": "mokup",
        "brand_id": 1,
        "brand_name": "Mok-Up",
        "metric": "broadcasts",
        "metric_id": 0,
        "metric_timestamp": 1589354145,
        "customer_id": 13,
        "external_id": "",
        "campaign_id": 24,
        "campaign_object_id": 3,
        "broadcast_id": 722,
        "broadcast_timestamp": 1589354143,
        "broadcast_type": "MAIL",
        "broadcast_event_type": "EMAIL",
        "broadcast_manual_options": {
            "campagne": null,
            "CustomerCount": 1,
            "paul": null,
            "__selectionEnvironment": "environment",
            "billing_address_formatted": "",
            "shipping_address_formatted": ""
        },
        "sub_type": "CAMPAIGN",
        "content_id": 339,
        "email_domain": "teamitg.com",
        "mailing_type": "",
        "test_mailing": false,
        "email_address_override": false,
        "campaign_name": "webhook order confirmation",
        "content_name": "Order confirmation",
        "subject": "Bedankt voor je bestelling",
        "customer_email_address": "person@deployteq.com",
        "email_address": "person@deployteq.com",
        "uuid": "63eb020f-1784-4e20-9cc9-ea5404f57c9e"
    }
]
Open
[
    {
        "portal_id": 1746,
        "portal_name": "mokup",
        "brand_id": 1,
        "brand_name": "Mok-Up",
        "metric": "opens",
        "metric_id": 691,
        "metric_timestamp": 1589801661,
        "customer_id": 13,
        "external_id": "",
        "campaign_id": 75,
        "campaign_name": "",
        "campaign_object_id": 3,
        "broadcast_id": 719,
        "broadcast_timestamp": 1589295496,
        "broadcast_type": "MAIL",
        "broadcast_event_type": "EMAIL",
        "broadcast_manual_options": {
            "Campagne": null,
            "CustomerCount": 1,
            "E-mailadres": null,
            "ProductJSON": null,
            "__selectionEnvironment": "environment",
            "billing_address_formatted": "",
            "cartURL": null,
            "paul": null,
            "shipping_address_formatted": ""
        },
        "sub_type": "CAMPAIGN",
        "content_id": 339,
        "content_name": "",
        "subject": "",
        "email_domain": "teamitg.com",
        "mailing_type": "",
        "test_mailing": false,
        "email_address_override": false,
        "customer_email_address": "",
        "email_address": "",
        "uuid": "c69cc862-5c43-4a84-bc53-d38bfac8fb5c",
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/81.0.4044.138 Safari\/537.36",
        "os": "Windows",
        "browser": "Chrome",
        "machine_generated": false
    }
]
Click
[
    {
        "portal_id": 1746,
        "portal_name": "mokup",
        "brand_id": 1,
        "brand_name": "Mok-Up",
        "metric": "clicks",
        "metric_id": 417,
        "metric_timestamp": 1589813526,
        "customer_id": 13,
        "external_id": "",
        "campaign_id": 24,
        "campaign_name": "",
        "campaign_object_id": 3,
        "broadcast_id": 718,
        "broadcast_timestamp": 1589295496,
        "broadcast_type": "MAIL",
        "broadcast_event_type": "EMAIL",
        "broadcast_manual_options": {
            "CustomerCount": 1,
            "__selectionEnvironment": "environment",
            "billing_address_formatted": "",
            "campagne": null,
            "paul": null,
            "shipping_address_formatted": ""
        },
        "sub_type": "CAMPAIGN",
        "content_id": 339,
        "content_name": "",
        "subject": "",
        "email_domain": "teamitg.com",
        "mailing_type": "",
        "test_mailing": false,
        "email_address_override": false,
        "customer_email_address": "",
        "email_address": "",
        "uuid": "f7747985-f93d-432e-a6aa-0c429a25f159",
        "user_agent": "Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/81.0.4044.138 Safari\/537.36",
        "link_id": 17786,
        "url": "https:\/\/www.mokupshop.com\/customer\/account\/",
        "alt": "Menu - Your account",
        "google_source": "",
        "google_medium": "",
        "google_term": "",
        "google_content": "",
        "google_campaign": "",
        "tags": [

        ],
        "os": "Windows",
        "browser": "Chrome"
    }
]
Bounce
[
    {
        "portal_id": 1746,
        "portal_name": "mokup",
        "brand_id": 1,
        "brand_name": "Mok-Up",
        "metric": "bounces",
        "metric_id": 1,
        "metric_timestamp": 1589813730,
        "customer_id": 458,
        "external_id": "",
        "campaign_id": 0,
        "campaign_object_id": 0,
        "broadcast_id": 724,
        "broadcast_timestamp": 1589813724,
        "broadcast_type": "MAIL",
        "broadcast_event_type": "SINGLEMAIL",
        "broadcast_manual_options": {
            "billing_address_formatted": null,
            "shipping_address_formatted": null
        },
        "sub_type": "SINGLEMAIL",
        "content_id": 339,
        "email_domain": "jnkdfjnkwefj.com",
        "mailing_type": "",
        "test_mailing": false,
        "email_address_override": false,
        "bounce_type": "hard",
        "bounce_code": "5.1.2",
        "bounce_reason": "other",
        "bounce_count_hard": 1,
        "bounce_count_soft": 0,
        "uuid": "50eaaa33-cdf2-4d9d-83d0-97b88b2517ed"
    }
]
Unsubscribe
[
    {
        "portal_id": 1746,
        "portal_name": "mokup",
        "brand_id": 1,
        "brand_name": "Mok-Up",
        "metric": "unsubscribes",
        "metric_id": 4,
        "metric_timestamp": 1589814299,
        "customer_id": 2,
        "external_id": "",
        "campaign_id": 0,
        "campaign_object_id": 0,
        "broadcast_id": 725,
        "broadcast_timestamp": 1589814127,
        "broadcast_type": "MAIL",
        "broadcast_event_type": "SINGLEMAIL",
        "broadcast_manual_options": {
            "billing_address_formatted": null,
            "shipping_address_formatted": null
        },
        "sub_type": "SINGLEMAIL",
        "content_id": 347,
        "email_domain": "hotmail.com",
        "mailing_type": "",
        "test_mailing": false,
        "email_address_override": false,
        "uuid": "3413400a-aaef-4c6f-bdc7-9fabafa9500a"
    }
]