Mailketing Webhook
Webhook mengirimkan notifikasi real-time ke URL yang Anda konfigurasi di menu Integrations → Webhook. Format: POST dengan Content-Type: application/json.
Konfigurasi
Masuk ke Menu → Integrations → Webhook (webhookext.php), lalu isi URL untuk setiap event:
| Event | Field DB | Deskripsi |
|---|---|---|
| Bounce | webhook | Saat email bounce (gagal terkirim) |
| Open | webhook_open | Saat penerima membuka email |
| Click | webhook_click | Saat link di email diklik |
| New Subscriber | webhook_newsub | Saat subscriber baru masuk |
| Unsubscribe | webhook_unsub | Saat subscriber berhenti berlangganan |
| Delivered | webhook_delivered | Saat email diterima server penerima (khusus akun Business API) |
1 · Open Track type: emailopen
Dikirim saat penerima membuka email.
{
"type": "emailopen",
"email": "subscriber@example.com",
"date": "2026-08-18 10:30:00",
"message_id": "abc123def456"
}
| Field | Type | Deskripsi |
|---|---|---|
type | string | Selalu "emailopen" |
email | string | Email penerima |
date | string | Waktu open (UTC, format Y-m-d H:i:s) |
message_id | string | ID unik pesan untuk tracking. Bisa custom (dari API) atau auto-generated |
2 · Click Track type: emailclick
Dikirim saat penerima mengklik link di email.
{
"type": "emailclick",
"email": "subscriber@example.com",
"link_clicked": "https://your-site.com/promo",
"date": "2026-08-18 10:35:00"
}
3 · Bounce type: bounce
Dikirim saat email bounce.
{
"type": "bounce",
"email": "subscriber@example.com",
"reason": "User Unknown",
"date": "2026-08-18 10:20:00",
"message_id": "abc123def456"
}
| Field | Type | Deskripsi |
|---|---|---|
type | string | Selalu "bounce" |
email | string | Email penerima yang bounce |
reason | string | Alasan bounce |
date | string | Waktu bounce (format Y-m-d H:i:s) |
message_id | string | ID unik pesan untuk tracking. Bisa custom (dari API) atau auto-generated |
message_id pada bounce berasal dari field jobid di tabel sending_log, yang nilainya sama dengan message_id di email_log / xout_log.4 · New Subscriber type: newsubscriber
Dikirim saat subscriber baru ditambahkan ke list.
{
"type": "newsubscriber",
"email": "subscriber@example.com",
"first_name": "John",
"last_name": "Doe",
"list_id": "1",
"mobile": "628123456789",
"date": "2026-08-18 10:15:00"
}
5 · Unsubscribe type: unsubscribe
Dikirim saat subscriber berhenti berlangganan.
{
"type": "unsubscribe",
"email": "subscriber@example.com",
"date": "2026-08-18 10:40:00"
}
6 · Delivered type: delivered
Dikirim saat server penerima menerima email (status 2.0.0). Hanya tersedia untuk akun Business API; isian URL-nya tampil di halaman Webhook bila akun Anda Business API.
{
"type": "delivered",
"send_time": "2026-10-19 03:00:00",
"orig": "sender@your-domain.com",
"rcpt": "subscriber@example.com",
"jobid": "<abc123def456@your-domain.com>",
"dsndiag": "smtp;250 2.0.0 OK"
}
| Field | Type | Deskripsi |
|---|---|---|
type | string | Selalu "delivered" |
send_time | string | Waktu email diterima server penerima (format Y-m-d H:i:s) |
orig | string | Alamat pengirim |
rcpt | string | Alamat penerima |
jobid | string | ID pesan, sama dengan message_id pada event bounce |
dsndiag | string | Respons SMTP dari server penerima |
Event ini dikirim untuk setiap email yang terkirim, jadi volumenya sama dengan jumlah email Anda. Pastikan endpoint menjawab cepat (batas waktu 10 detik).
Contoh Penerima (PHP)
<?php
$payload = json_decode(file_get_contents('php://input'), true);
switch ($payload['type']) {
case 'emailopen':
// $payload['email'], $payload['date'], $payload['message_id']
break;
case 'emailclick':
// $payload['email'], $payload['link_clicked']
break;
case 'bounce':
// $payload['email'], $payload['reason'], $payload['message_id']
break;
case 'newsubscriber':
// $payload['email'], $payload['list_id']
break;
case 'unsubscribe':
// $payload['email']
break;
case 'delivered':
// $payload['rcpt'], $payload['jobid'], $payload['send_time'], $payload['dsndiag']
break;
}