{CODICTS} Snippets is now available

Voxel OneSignal Addon

The {CODICTS} Voxel OneSignal Addon plugin bridges the Voxel Theme and OneSignal to deliver web and mobile push notifications triggered by Voxel’s built-in app events. When something happens on your site — a new message, a booking, a post creation — the plugin automatically sends a push notification to the right user through OneSignal. No custom code required.

Installation & Activation

Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.

After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.

Once activated, navigate to “OneSignal Addon” in the WordPress admin sidebar to configure your settings.

Important: Before using this plugin, make sure the OneSignal plugin is installed and configured with your OneSignal App ID and REST API Key. The CoDicts plugin reads these credentials from the OneSignal plugin — it does not store them separately.


How It Works

The plugin connects Voxel’s app event system to OneSignal’s push notification API. It supports two notification paths:

Notification TypeTriggerRecipientsUse Case
IndividualAny Voxel app event with in-app notifications enabledThe specific user who should receive the notificationNew message received, booking confirmed, post approved, etc.
Broadcast (All)A new post is created and published for an enabled post typeAll OneSignal subscribersNew listing added, new event posted, new article published

Individual notifications work automatically — every Voxel event that has in-app notifications enabled will also trigger a push notification to the recipient.

Broadcast notifications must be enabled per post type in the plugin settings (see below).


User Identification

For individual notifications to reach the right person, the plugin automatically identifies logged-in users with OneSignal using their WordPress user ID as a OneSignal External User ID. This happens in the background on every page load — no setup required from you or your users.

When a user visits your site while logged in, the plugin registers their device with OneSignal. When they log out, the association is cleared. This means users must have visited your site at least once while logged in for individual push notifications to reach them.


Settings

Navigate to “OneSignal Addon” in the WordPress admin sidebar to configure the plugin.

Deep Link URL

If you have a mobile app, enter your app’s deep link schema (e.g., myapp://example.com). When set, notification URLs are converted from web URLs to app deep links, so tapping a notification opens the content directly in your native app.

Leave this blank if you don’t have a mobile app — notifications will open in the browser.

SettingDescription
Deeplink URLYour app’s deep link schema prefix (e.g., myapp://example.com).
Simple URL for APP URLWhen enabled, web URLs are converted to a structured format using post type and post ID instead of the page slug.
Custom Query ParametersDefine the deep link structure using placeholders: {post_type} and {post_id}. Example: ?post_type={post_type}&post_id={post_id}

Tip: If you have specific URLs that should always open in a browser instead of the app, add is_web=true as a URL parameter. The plugin will skip deep link conversion for those URLs.

Broadcast Notifications per Post Type

For each Voxel post type, you can enable broadcast notifications that go to all subscribers whenever a new post of that type is created and published.

SettingDescription
Enable ToggleTurn on/off broadcast notifications for this post type.
SubjectNotification heading template. Supports Voxel Dynamic Tags. Default: A new post has been created - @post(title)
MessageNotification body template. Supports Voxel Dynamic Tags.

The subject and message fields support Voxel Dynamic Tags for personalized content. Common tags include:

TagOutput Example
@post(title)Joe’s Coffee Shop
@post(:category)Restaurants
@author(display_name)Jane Smith
@site(title)My Directory

If the post has a featured image, it is automatically attached to the notification.

Segment Name

SettingDefaultDescription
Segment NameAllThe OneSignal segment used for broadcast notifications. Change this if you want to target a specific segment instead of all subscribers.

Deferred Notifications

Stagger notification delivery with a random delay to prevent notification storms — especially useful for broadcast notifications.

SettingDescription
FromMinimum delay in seconds before sending.
ToMaximum delay in seconds before sending. Must be equal to or greater than “From”.

Each notification is delayed by a random value between these two numbers. Set both to 0 for near-immediate delivery (1-second minimum).


Individual Notifications (Automatic)

Individual push notifications work automatically for every Voxel app event that has in-app notifications enabled. You don’t need to configure anything specific — if Voxel sends an in-app notification, this plugin sends a matching push notification.

Examples of events that trigger individual push notifications:

EventRecipient
New direct message receivedThe message recipient
Booking confirmed/declinedThe customer
Post approved/declinedThe post author
New review receivedThe listing owner
New order placedThe vendor

The notification uses the same subject and details as Voxel’s in-app notification. The site icon is used as the notification icon, unless the event provides its own icon.


Broadcast Notifications (New Posts)

When enabled for a post type, broadcast notifications are sent to all OneSignal subscribers whenever a new post of that type is created and published — whether from the Voxel frontend submission form or from the WordPress admin.

Broadcast notifications only fire once per post — on the first publish. Updating an already-published post does not trigger another broadcast. This is tracked with an internal flag on each post.

Note: If you need to send a broadcast for an already-published post, use the manual “Notify All Users” button (see below).


Manual “Notify All Users”

A “{C} Notify All Users” meta box appears on the sidebar of every post edit screen in the WordPress admin. Clicking the “Notify All Users” button sends a push notification to all subscribers for that specific post.

This is useful for:

Sending a notification for a post that was published before the plugin was installed. Re-notifying all users about an updated or featured post. Sending notifications for posts that were published without the broadcast toggle enabled.

Warning: This is a force push — it sends to all subscribers immediately without the deferred delay or the condition filter. Make sure to save the post before clicking the button. You will be asked to confirm before sending.


Duplicate Prevention

The plugin includes multiple layers of protection against duplicate notifications:

MechanismWhat It Prevents
Idempotency keysUUID-based keys sent to OneSignal prevent the same notification from being delivered twice.
First-publish flagA post meta flag ensures broadcast notifications only fire on the first publish, not on updates.
Schedule checkBefore scheduling a notification via WP-Cron, the plugin checks if an identical event is already scheduled.

Notification Condition Filter (For Developers)

Developers can conditionally block broadcast notifications using a PHP filter. This is useful for business logic like “only notify for featured posts” or “only notify for posts in certain categories.”

add_filter('codicts-voxel-onesignal-addon::create_notification_condition', function($condition, $post_id) {
    // Only send notifications for posts tagged as 'featured'
    if (!has_term('featured', 'category', $post_id)) {
        return false; // Block the notification
    }
    return $condition;
}, 10, 2);

When a notification is blocked by this filter, the post is flagged internally and the notification is silently skipped.

Developers can also customize the post type priority for deep link slug resolution:

add_filter('codicts-voxel-onesignal-addon::priority_url_map', function($types) {
    return ['places', 'events', 'post']; // Check these post types first when resolving slugs
});

Troubleshooting

“Voxel Theme Not Detected” Error

Ensure the Voxel Theme is installed and set as the active theme (or parent theme if using a child theme).

“OneSignal Push Notifications Plugin Not Detected” Error

Install and activate the OneSignal Free Web Push Notifications plugin from the WordPress plugin directory. Make sure it is configured with your OneSignal App ID and REST API Key.

Notifications Not Being Sent

Check the following common causes:

CauseSolution
OneSignal credentials missingVerify your App ID and REST API Key are set in the OneSignal plugin settings.
Post type not enabledFor broadcast notifications, enable the post type in the plugin settings.
Post not publishedBroadcast notifications only fire for posts with “publish” status.
Post already published onceThe first-publish flag prevents re-triggering. Use the manual “Notify All” button instead.
Condition filter blockingCheck if any custom create_notification_condition filter is returning false.
WP-Cron not runningNotifications are scheduled via WP-Cron. If your site has very low traffic, consider setting up a server-side cron job.

Notifications Going to Wrong Users

Push notifications target users by their OneSignal External User ID, which is set when users visit your site while logged in. If a user has never visited while logged in, their device isn’t linked to their account. Check the browser console for OneSignal login errors.

Deep Links Not Working

CauseSolution
Deep link URL not setEnter your app’s deep link schema in the plugin settings.
is_web=true in the URLThis parameter intentionally bypasses deep linking. Remove it if you want deep links.
Post not found from slugEnsure the post exists and has a valid permalink. Try enabling “Simple URL” mode with custom query parameters.

“Notify All Users” Button Not Working

Make sure the post is saved before clicking the button. Check the browser console for JavaScript errors. If the page has been open for a long time, refresh it first — the security token may have expired.

Duplicate Notifications

The plugin has multiple deduplication mechanisms (idempotency keys, first-publish flag, schedule checks). If you’re still seeing duplicates, check for other plugins that might be firing Voxel events multiple times, or browser extensions that might be re-triggering page requests.


For further support, visit codicts.com or contact us at support@codicts.com.

CoDicts Co., Ltd. © 2021-2026. All rights reserved