DocsOMailerBounce & Complaint Webhooks
Deliverability

Bounce & Complaint Webhooks

OMailerorravo.com/docs/omailer/bounce-webhooks

Bounce & Complaint Webhooks

OM_BounceWebhook exposes endpoints for inbound delivery status notifications from ESP providers.

Webhook URLs

ProviderURL
Mailgunhttps://yoursite.com/wp-json/omailer/v1/webhooks/mailgun
SendGridhttps://yoursite.com/wp-json/omailer/v1/webhooks/sendgrid
Postmarkhttps://yoursite.com/wp-json/omailer/v1/webhooks/postmark

What Happens on Bounce

  1. Hard bounce → subscriber status set to bounced; email added to suppression list with reason bounce
  2. Soft bounce → logged in om_events; subscriber not changed on first occurrence
  3. Complaint (spam report) → subscriber unsubscribed; email added to suppression list with reason complaint

Custom Webhook Handler

php// Register a custom provider
add_filter( 'om_bounce_providers', function( array $providers ): array {
    $providers['mymailprovider'] = [
        'endpoint' => 'mymailprovider',
        'handler'  => 'my_webhook_handler',
    ];
    return $providers;
});

function my_webhook_handler( WP_REST_Request $request ): void {
    $body = $request->get_json_params();
    if ( $body['event'] === 'bounce' ) {
        OM_BounceWebhook::process_bounce( $body['email'], 'hard' );
    }
}
Bounce & Complaint Webhooks — OMailer Docs — Orravo