PHP code example of divante-ltd / pimcore-notifications
1. Go to this page and download the library: Download divante-ltd/pimcore-notifications library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
divante-ltd / pimcore-notifications example snippets
$notification = new \PimcoreNotifications\Model\Notification();
$notification
->setTitle('your title of notification goes here')
->setMessage('your message')
->setType('info') // allowed: info|success|error
->setUser($user)
->setFromUser($fromUser) // optional
->setLinkedElement($document) // optional, allowed: Document|Asset|Object
;
$notification->save();
php pimcore/cli/console.php pimcore-notifications:run