Software

Demo

You Will Also Need

You need to create the interface for how visitors subscribe to notifications—we will show you example code, but you’ll need to get folks to opt-in. The OneSignal Web Push SDK documentation is a good resource for information on setting this up, too.

Usage

Note: OneSignal has a built-in segment called All that contains all your subscribers. It can be used to send notifications to all your subscribers.

In EE, create your matching categories. You must set up a category for each audience segment you defined in OneSignal.

Set up a custom category field whose value exactly matches the name of the matching audience segment in OneSignal.

Set up your EE channel(s). You can either set up an EE channel specifically for your notification entries or you can integrate Hop PushEE functionality into existing channels.

PushEE sets the URL for the notification to match the Comment URL in the channel settings. You can also override this directly in an EE template set for sending push notifications.

In your channel, select one custom field that will trigger notifications. This field may use be a Select Dropdown or a Radio Button field. The field must have three values:
Don’t send<br />
Send<br />
Sent

Create a template for Hop PushEE to use when sending a notification. Select it in the Hop PushEE settings.
Here’s a simple example of the Hop PushEE tags used in the template. The icon, title and url will use defaults, but can also be set using specific tags. Any text output by the template will appear as the body of the notification. If the template outputs nothing, the notification won’t be sent.

{exp:hop_pushee:set_icon}https://site.com/images/icon.png{/exp:hop_pushee:set_icon}<br />
{exp:hop_pushee:set_title}{ title } - from { site_name }{/exp:hop_pushee:set_title}<br />
{exp:hop_pushee:set_url}{url_title_path="news/item"}{/exp:hop_pushee:set_url}<br /><br />
{if summary == ''}Click here to read the article{if:else}{summary}{/if}
Please Note: you don’t need to use any {exp:channel:entries} tag in the template to display the Hop PushEE field content. Hop PushEE uses the details of the entry you are currently saving.

Add-On Setup

Go to Modules > Hop PushEE > Settings.

Enter your OneSignal app id and API key.

Select which custom field(s) in your notifications channel should trigger the notification.

Select which category custom field matches to your OneSignal segments.

Select which entry status(es) trigger the notification.

Enter a default icon URL. This must be an absolute URL, using http:// or https://

Select the template that displays the notification content.

Send a Notification

tl;dr: Notifications are triggered when all conditions set in the Add-On settings are met. The conditions to be met are:

Custom field is set to Send.

The entry status matches the triggering status(es).

The entry is saved/published.

Create a new entry in your channel.

Set the custom field that determines the notification status to Send. After the notification is sent, the value of the field will change to Sent.

Select the category or categories for any audience segments you want to receive the notification.

Select an entry status that enables notification.

Publish your entry. When all conditions are met, the notification will be sent instantly.

Note: You may send multiple notifications from the same entry, as long as you reset the field and status appropriately.

Note: Your notification will be sent at the moment the entry is published. You cannot future-date your entry and have the notification send at that time; the notification will be sent immediately.

Note: Browser notifications will not display HTML or images, only text. You can, however, vary the icon.

Updating

Updating is easy:

Download a new version from this website, and extract on your hard drive.

Upload the new files to their appropriate locations.

Uninstalling

Navigate to the Add-Ons/Modules tab in your EE control panel and uninstall the module.