r-martins/mautic-plugin-onesignal-web16

OneSignal Web SDK v16: use include_subscription_ids for web, and mark campaign push as failed when OneSignal returns errors or an empty id in JSON (including HTTP 200).

Maintainers

Package info

github.com/r-martins/mautic-plugin-onesignal-web16

Type:mautic-plugin

pkg:composer/r-martins/mautic-plugin-onesignal-web16

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-04-23 02:09 UTC

This package is auto-updated.

Last update: 2026-04-23 02:11:03 UTC


README

Plugin for Mautic 7.x that avoids editing core for OneSignal web push (Web SDK v16 subscription IDs) and for treating OneSignal JSON errors in HTTP-200 responses as send failures in campaigns.

What it does

  1. For web (non-mobile) push, sends include_subscription_ids instead of include_player_ids in the OneSignal REST request (aligned with subscription IDs from Web SDK v16 / Mautic push_ids).
  2. For mobile, keeps include_player_ids.
  3. If the OneSignal API returns HTTP 200 with a JSON errors payload or with id empty or null, the response is coerced to HTTP 422 so the default CampaignSubscriber does not record a false “delivered” outcome.

Requirements

  • PHP >= 8.2
  • Mautic 7.x (mautic/core-lib ^7.0)

Install (Composer, recommended for Packagist)

From the Mautic project root (Composer-based install):

composer require mtc/mautic-plugin-onesignal-web16
php bin/console mautic:plugins:reload
php bin/console cache:clear

In the Mautic UI: Settings → Plugins, install/enable OnesignalWeb16 if necessary.

License

GPL-3.0-or-later (same family as Mautic core).