Ibexa DXP Push Connector
The push.delivery Connector from ethinking GmbH lets you enhance your Ibexa DXP experience with providing access to new ways of reaching your customers using your content. It establishes the possibility to send push notifications to various platforms from the inside of your CMS. The connector will provide its own tabs next to the admin section to let your CMS admin easily set up all necessary connections. Moreover, it is designed to create and alter distribution channels or push templates.
Requirements
-
Ibexa DXP (eZ Platform) 3+
-
Account with push.delivery by ethinking
Setup
Pre-Installation
Add following bundles in the config/bundles.php
Ethinking\PushConnectorBundle\EzPlatformPushConnectorBundle::class => ['all' => true], Ethinking\EthinkingPushApiBundle\EthinkingPushApiBundle::class => ['all' => true],
Installation
The recommended way to install a library is via composer:
composer require ethinking/ibexa-push-connector "^3.1"
Post-Installation
-
Create config/routes/ezplatform_push_connector.yaml with the next code:
ezplatform_push_connector: resource: "@EzPlatformPushConnectorBundle/Resources/config/routing.yaml" prefix: /
-
Create config/packages/push_mapping.yaml with the format:
ezplatform: system: admin_group: push_config: content_types_map: article: webpush: fields: title: '<title_content_field>' message: '<message_content_field>' enabled: true
Example:
ezplatform: system: admin_group: push_config: content_types_map: article: webpush: fields: title: 'title' message: 'short_title' enabled: true
To specify the content fields inside Ibexa that should be used for the push payload a mapping is needed. You are flexible to define which content fields can be used. This makes it possible to define separate content fields which will be only used for the content of your push notification.
Import this file in config/packages/ezplatform.yaml
imports: - push_mapping.yaml
Replace <title_content_field> and <message_content_field> with the identifier of respective content fields. Currently we support Textline / ezstring field types -
Create push_delivery_main_settings table in MySQL database "ezp"
Use the following command:
php bin/console ibexa:push-connector:create-tables
Or execute SQL code manually:
create table push_delivery_main_settings ( settings_id INTEGER NOT NULL DEFAULT 1, domain VARCHAR(50) NOT NULL, client_id VARCHAR(50) NOT NULL, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, created_on DATETIME NOT NULL, updated_on DATETIME NOT NULL, CONSTRAINT PK_PUSH_DELIVERY_MAIN_SETTINGS PRIMARY KEY(settings_id) );
-
Update assets
yarn encore dev
-
Clear cache
php bin/console c:c
If you’re getting an error about missing dependencies in the entrypoints.json, try to delete manually "public/assets/ezplatform" directory and update assets again using command "composer install". |
Push Connector
Configuration
After installation, a new menu item "Push" will appear in the navigation with the sub menu item "Main settings" http://YOUR_WEBSITE_URL/admin/push/mainsettings
Fill out fields on the "Main settings" page with the received information. To verify the connection you can test this.
After saving settings, add embed code placeholder into your twig template for frontend |
{{ ibexa_push_connector_embed_code() }}
Create a new channel on the "Channels" page http://YOUR_WEBSITE_URL/admin/push/channel
Make sure you create only one channel with webpush platform because subscriptions will be always done against the webpush channel found by the system |
History
You can review status of pushes on the archive page http://YOUR_WEBSITE_URL/admin/push/archive
Dependencies
{
"symfony/dependency-injection": "^5.0",
"symfony/http-kernel": "^5.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/http-client": "^4.3|^5.0",
"symfony/http-client-contracts": "^1.1.8|^2",
"symfony/validator": "^3.4.30|^4.3.3|^5.0",
"symfony/mime": "^4.3|^5.0",
"ethinking/push-api": "^3.1"
}
Workflow
-
When main settings is saved in Ibexa DXP, this will be used by Ibexa DXP for communicating with push.delivery service
-
When a channel is created in Ibexa DXP:
-
When the Ibexa DXP frontend is accessed from browser, the browser will be registered for push against this tag in push.delivery
-
When an article is pushed from Ibexa DXP backend, push notification is send from push.delivery to all subscribers of this tag