Moderate
Moderate is a pipeline for processing mailing moderation actions. It is available only for indirect channels that have the Enable moderation (With moderate) option enabled in their main settings.
How moderation works
From a technical perspective, moderation is a separate launch of a mailing, where the message is sent not to the Message pipeline, but to Moderate. In this pipeline, you can implement the logic for sending content for approval, processing the moderation result, and registering the corresponding events.
User workflow
-
Creation and activation. The user creates a placement campaign on a channel with moderation enabled and activates it. The campaign receives the ModerationPending status. The edit form is locked, and only the Abort button is available.
-
Sending for moderation. The platform launches a binary campaign process with the
SendForModerate=trueflag. Messages are routed to the Moderate pipeline via thepiper_moderatequeue instead of being sent directly. The pipeline processes the content (e.g., sends it to an external moderation service via HTTP Request). -
Moderation result. The external service returns a result processed by the Eventer pipe:
moderate_pass— moderation passed. Campaign status changes to ModerationPassed. The mailing will launch on schedule if configured, or via the Run Now button.moderate_error— moderation failed. Campaign status changes to ModerationError. A red warning icon and the error message from the Eventermessagefield are displayed in the interface.
-
Fix and resubmit. With ModerationError status, the user can fix the campaign content and save it again. The campaign is automatically sent for re-moderation (returns to ModerationPending status).
-
Launch the mailing. After successful moderation (ModerationPassed), the mailing launches on schedule or via the Run Now button, and the message is delivered through the regular Message pipeline.
Limitations
- A campaign in ModerationPending or ModerationPassed status cannot be re-activated — it can only be deactivated.
- The "Run Now" button is unavailable for campaigns in ModerationPending and ModerationError statuses — moderation is required first.
- The "Start now" checkbox is hidden when creating a campaign on a channel with moderation enabled.
Pipeline configuration
To manage moderation status, use the Eventer pipe with event types moderate_pass and moderate_error.
For moderate_pass, moderate_error, and stop events, the event_type parameter is specified in Eventer, and action_type is not required. For all other event types, event_type is not used — instead, action_type (the event ID from the channel's Events section) is specified.
Minimal example
A pipeline that sends content for moderation via HTTP and processes the result:
[
{
"id": 1,
"type": "pack",
"params": {
"type": "JSON",
"template": {
"content": "$template.text",
"campaign_id": "$#origin.c_id"
}
},
"outs": {
"success": 2
}
},
{
"id": 2,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "json",
"url": "https://api.example.com/moderate",
"success_codes": [200]
},
"outs": {
"success": 3,
"error": 4
}
},
{
"id": 3,
"type": "event",
"params": {
"event_type": "moderate_pass",
"event": {
"send_message_id": "$origin.send_message_id"
}
}
},
{
"id": 4,
"type": "event",
"params": {
"event_type": "moderate_error",
"event": {
"send_message_id": "$origin.send_message_id",
"message": "$in.body.error"
}
}
}
]
In this example:
- Pipe 1 (Pack) forms the request body with message content and campaign ID.
- Pipe 2 (HTTP Request) sends the request to the external moderation service. Depending on the result, it routes to pipe 3 (success) or pipe 4 (error).
- Pipe 3 (Eventer) registers a
moderate_passevent — the campaign gets ModerationPassed status. - Pipe 4 (Eventer) registers a
moderate_errorevent with the error text from the service response ($in.body.error) — the campaign gets ModerationError status, and the error text will be displayed in the interface.