Email webhooks

created

The user was added to our database

event (string)  
user_id (int)  
project_id (int)  
reg_type  
event_id (int)  
ts (int)  
split_group(int)  
client_user_id (int)  
project (string)  
meta --optional (array)  
user --optional (array)  
email --optional (string)
{  
  "0": {  
    "event": "created",  
    "user_id": 899899,  
    "project_id": 99,  
    "reg_type": "sys_letter",  
    "event_id": 290290,  
    "meta": {  
      "relay": "domain.com",  
      "from_email": "[email protected]",  
      "sender_id": null,  
      "action_type": 32,  
      "project_id": 99,  
      "partner_id": "1832",  
      "receiver_id": 899891,  
      "mail_id": 2222229009,  
      "track_id": null,  
      "channel": "domain_channel.com",  
      "title_type": null,  
      "campaign": null,  
      "subject_id": 15,  
      "predict_id": null,  
      "split_group": null,  
      "login_partner": 15599,  
      "unsub_domain": "some.com",  
      "domain_content": "some.com"  
    },  
    "ts": 1549382627,  
    "split_group": null,  
    "client_user_id": "991",  
    "project": "SomeProject",  
    "email": "[email protected]",  
    "user": {  
      "id": 899899,  
      "project_id": 99,  
      "email": "[email protected]",  
      "name": "Some Name",  
      "language": "en",  
      "last_online": 0,  
      "last_mailed": 0,  
      "last_reaction": 0  
    }  
  }  
}

sent

The emails that were sent to the user. If you received the sent webhook and after that you did not receive any other webhooks, it means that the email was successfully delivered to the user. If after webhook sent you received webhook lost - the email was not delivered to the user.

event (string)
mail_id (int)
user_id (int)
project_id (int)
mail_source_id (int)
server (string)
source_id (int)
template_id (int)
ts (int)
split_group(int)
project (string)
event_id --optional (int)
client_user_id --optional (int)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "sent",
     "mail_id": 2222229009,
     "user_id": 899899,
     "project_id": 99,
     "server": "mail10",
     "event_id": 290290,
     "source_id": 4,
     "template_id": 3110,
     "ts": 1549382420,
     "split_group": 416,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549248554",
        "last_mailed": "1549347648",
        "last_reaction": "1549071762"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "message",
        "server": "mail10"
     },
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "type_id": 8,
     "category_id": 2
  }
}

open

The email was opened by the user (including re-openings of the email if more than 5 minutes have passed since the previous opening)

event (string)
user_id (int)
mail_id (int)
project_id (int)
mail_source_id (int)
source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "open",
     "user_id": 899899,
     "mail_id": 2222229009,
     "project_id": 99,
     "source_id": 4,
     "template_id": 3421,
     "ts": 1549382463,
     "split_group": 417,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382268",
        "last_mailed": "1549381895",
        "last_reaction": "1549382285"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "favorite",
        "server": "mail10"
     },
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "type_id": 8,
     "category_id": 2,
     "event_id": 290290
  }
}

confirm

Receiving confirm (the first click on the email by the user)

event (string)
user_id (int)
project_id (int)
reg_type
event_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
meta --optional (array)
user --optional (array)
email --optional (string)
{  
   "0": {  
     "event": "confirm",  
     "user_id": 899899,  
     "mail_id": 2222229009,  
     "type_id": 8,  
     "project_id": 99,  
     "server": "mail10",  
     "source_id": 4,  
     "browser": "Firefox",  
     "template_id": 791,  
     "ts": 1549382688,  
     "split_group": 356,  
     "client_user_id": "991",  
     "project": "SomeProject",  
     "email": "[email protected]",  
     "user": {  
        "id": 899899,  
        "project_id": 99,  
        "email": "[email protected]",  
        "name": "Some Name",  
        "language": "en",  
        "last_online": "1549382688",  
        "last_mailed": "1549382680",  
        "last_reaction": "1549382688"  
     },  
     "msg": {  
        "mail_id": 2222229009,  
        "category_id": "1",  
        "source_id": 4,  
        "type_id": 8,  
        "type_sig": "welcome",  
        "server": "mail10"  
     },  
     "meta": \[],  
     "category_id": 1,  
     "event_id": 290290  
  }  
}

click

The fact of a click on the email by the user (including repeated clicks if more than 5 minutes have passed since the previous click)

event (string)
user_id (int)
mail_id (int)
type_id (int)
project_id (int)
server (string)
mail_source_id (int)
source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
browser --optional
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "click",
     "user_id": 899899,
     "mail_id": 2222229009,
     "type_id": 8,
     "project_id": 99,
     "server": "mail10",
     "source_id": 4,
     "browser": "iPhone",
     "template_id": 3410,
     "ts": 1549382495,
     "split_group": 417,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382200",
        "last_mailed": "1549381199",
        "last_reaction": "1549382494"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "visit",
        "server": "mail10"
     },
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "category_id": 2,
     "event_id": 290290
  }
}

reject

The email was rejected from sending

event (string)
user_id (int)
project_id (int)
type_id (int)
reject_reason
ts (int)
split_group(int)
client_user_id (int)
project (string)
meta --optional
email --optional
event_id --optional (int)
source_id --optional (int)
template_id --optional (int)
error_message --optional
user --optional (array)
email --optional (string)
{
  "0": {
     "event": "reject",
     "user_id": 899899,
     "project_id": 99,
     "type_id": 8,
     "reject_reason": "often_duplicate",
     "meta": {
        "type_id": 8,
        "id_custom": null,
        "id_stat": 229009
     },
     "source_id": 4,
     "ts": 1549382344,
     "split_group": 358,
     "client_user_id": null,
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549381819",
        "last_mailed": "1549382344",
        "last_reaction": "1549382339"
     }
  }
}

lost

The email was sent but had not been delivered

event (string)
user_id (int)
project_id (int)
type_id (int)
mail_id (int)
lost_reason (string)
lost_reason_id (int)
reject_reason (string)
reject_reason_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
source_id --optional (int)
template_id --optional (int)
email --optional (string)
event_id --optional (int)
{
  "0": {
    "event": "lost",
    "user_id": 1593206891,
    "project_id": 17125,
    "type_id": 2,
    "lost_reason": "User invalid",
    "lost_reason_id": 2,
    "reject_reason": "does_not_exist",
    "reject_reason_id": 550,
    "email": "[email protected]",
    "source_id": 0,
    "template_id": 42610,
    "event_id": 98929656070,
    "mail_id": 21727892269,
    "ts": 1661854585,
    "split_group": null,
    "client_user_id": null,
    "project": "SomeProject",
    "user": {
      "id": 1593206891,
      "project_id": 17125,
      "email": "[email protected]",
      "name": "Some Name",
      "language": "en",
      "last_online": "0",
      "last_mailed": "1661854225",
      "last_reaction": "0"
    },
    "msg": {
      "mail_id": "21727892269",
      "category_id": "1",
      "source_id": "0",
      "type_id": 2,
      "type_sig": "System_Mailtype",
      "server": "mail250"
    },
    "category_id": 1
  }
}

unsub

The emails that were not sent to the user due to unsubscribe

event (string)
user_id (int)
mail_id (int)
project_id (int)
server (string)
unsub_source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
source_id --optional (int)
unsub_source --optional
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "unsub",
     "user_id": 899899,
     "mail_id": null,
     "project_id": 99,
     "server": "unknown",
     "unsub_source_id": 108,
     "source_id": false,
     "template_id": null,
     "ts": 1549382568,
     "split_group": 351,
     "client_user_id": "991",
     "project": "SomeProject",
     "unsub_source": "admin",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382430",
        "last_mailed": "1549382475",
        "last_reaction": "1549380725"
     },
     "event_id": 290290
  }
}

abuse

The user complained via the mail client

event (string)
user_id (int)
mail_id (int)
project_id (int)
server (string)
result
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
mail_source_id --optional (int)
source_id --optional (int)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
email --optional (string)
{
  "0": {
     "event": "abuse",
     "user_id": 899899,
     "mail_id": 2222229009,
     "project_id": 99,
     "server": "mail10",
     "result": "already_unsub",
     "source_id": 4,
     "template_id": 2671,
     "ts": 1549382596,
     "split_group": 375,
     "client_user_id": "991",
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382579",
        "last_mailed": "1549372446",
        "last_reaction": "1548235847"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "2",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "search_you_m",
        "server": "mail10"
     },
     "meta": [],
     "type_id": 8,
     "category_id": 2,
     "event_id": 290290
  }
}

request

Request on the client's side on the recommendation system

event (string)
user_id (int)
project_id (int)
type_id (int)
mail_source
event_id (int)
source_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
email (string) --optional
user (array) --optional
{
  "0": {
    "event": "request",
    "user_id": 899899,
    "project_id": 99,
    "type_id": 8,
    "event_id": 290290,
    "source_id": 4,
    "ts": 1549381952,
    "split_group": null,
    "client_user_id": "991",
    "project": "SomeProject",
    "email": "[email protected]",
    "user": {
      "id": 899899,
      "project_id": 99,
      "email": "[email protected]",
      "name": "Some Name",
      "language": "en",
      "last_online": "1548912693",
      "last_mailed": "1549301485",
      "last_reaction": "1548308703"
    }
  }
}

retention

The user's first click in lifetime (calendar day). The retention webhook is sent when there's a click in the email but not more often than once a day, and on the condition that there were no reactions during the previous 2 hours (last_reaction)

event  (string)
user_id (int)
mail_id (int)
type_id (int)
project_id (int)
server (string)
mail_source_id (int)
source_id (int)
template_id (int)
ts (int)
split_group(int)
client_user_id (int)
project (string)
user --optional
campaign_id --optional (int)
type_id --optional (int)
category_id --optional (int)
msg --optional (array)
email --optional (string)
{
  "0": {
     "event": "retention",
     "user_id": 899899,
     "mail_id": 2222229009,
     "type_id": 8,
     "project_id": 99,
     "server": "mail10",
     "source_id": 4,
     "browser": "Chrome mobile",
     "template_id": 2368,
     "ts": 1549382720,
     "split_group": 351,
     "client_user_id": "991",
     "project": "SomeProject",
     "email": "[email protected]",
     "user": {
        "id": 899899,
        "project_id": 99,
        "email": "[email protected]",
        "name": "Some Name",
        "language": "en",
        "last_online": "1549382609",
        "last_mailed": "1549382518",
        "last_reaction": "1549382719"
     },
     "msg": {
        "mail_id": 2222229009,
        "category_id": "1",
        "source_id": 4,
        "type_id": 8,
        "type_sig": "welcome",
        "server": "mail10"
     },
     "meta": [],
     "category_id": 1
  }
}