Message
Message is the main pipeline of a channel. All messages sent by a mailing go through it.
Here you define the chain of pipes that builds a request to an external service, sends it, processes the response, and registers events (send, delivery, non-delivery, etc.).
The pipeline is configured as a JSON array on the Pipelines > Message tab when setting up a channel. By default, the editor contains an empty array [].
Minimal working example
A typical Message pipeline consists of four pipes: data packing, HTTP request, event registration on success, and event registration on error.
[
{
"id": 1,
"type": "pack",
"params": {
"type": "JSON",
"template": {
"chat_id": "$subscription.chat_id",
"text": "$template.text"
}
},
"outs": {
"success": 2
}
},
{
"id": 2,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "json",
"url": "https://api.example.com/send",
"success_codes": [200]
},
"outs": {
"success": 3,
"error": 4
}
},
{
"id": 3,
"type": "event",
"params": {
"channel_id": 10001,
"action_type": 100001,
"event": {
"send_message_id": "$origin.send_message_id"
}
}
},
{
"id": 4,
"type": "event",
"params": {
"channel_id": 10001,
"action_type": 100003,
"event": {
"send_message_id": "$origin.send_message_id"
}
}
}
]
Here:
- Pack (id: 1) — builds JSON from subscription and template data
- HTTP Request (id: 2) — sends a request to the external API
- Eventer (id: 3) — registers a send event on HTTP 200
- Eventer (id: 4) — registers a non-delivery event on error
For details on pipeline structure and available pipes, see the Pipelines and Pipes sections.