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

  1. Ibexa DXP (eZ Platform) 3+

  2. 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

  1. Create config/routes/ezplatform_push_connector.yaml with the next code:

    ezplatform_push_connector:
      resource: "@EzPlatformPushConnectorBundle/Resources/config/routing.yaml"
      prefix:   /
  2. 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

    This maps the fields in the content to be pushed with the push payload.

    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
  3. Run the script in MySQL database "ezp"

    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)
    );
  4. Update assets

    yarn encore dev
  5. 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.

main settings
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

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

Push

From backend, the article can be pushed to the target channels by clicking the push icon.

push

History

You can review status of pushes on the archive page http://YOUR_WEBSITE_URL/admin/push/archive

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

  1. When main settings is saved in Ibexa DXP, this will be used by Ibexa DXP for communicating with push.delivery service

  2. When a channel is created in Ibexa DXP:

    1. System will make sure there is always a default tag in push.delivery with sourceID 'push-connector-tag-general-<client-ID>'. If missing, this will be created

    2. App is created in push.delivery and will be connected to tag mentioned above

  3. When the Ibexa DXP frontend is accessed from browser, the browser will be registered for push against this tag in push.delivery

  4. When an article is pushed from Ibexa DXP backend, push notification is send from push.delivery to all subscribers of this tag

diagram-classes