markocupic / contao-frontend-user-notification
Display notifications to logged in frontend users
Installs: 118
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.2
- contao/core-bundle: ^5.3
- markocupic/contao-component-vue-js: ^3.3
- ramsey/uuid: ^3.0 || ^4.0
Requires (Dev)
- contao/manager-plugin: ^2.12
README
Frontend User Notification Extension for the Contao CMS
This Contao extension can be used to display notifications to logged-in users in the Contao frontend.
All you have to do is...
Embed a frontend module of the type Member Notifications
in your Contao layout.
You can generate the message in the backend or have it generated programmatically.
// Add the notification programmatically $type = 'happy-birthday-msg'; /** @var \Contao\FrontendUser $user */ $user = $this->getUser(); // Select a user who should have a notification displayed in the frontend. $messageTitle = 'Happy Birthday' $messageText = 'bla, bla, bla'; $endOfLifeTimeStamp = time() + 7*24*3600; // 1 week new Markocupic\ContaoFrontendUserNotification\Notification\DefaultFrontendUserNotification($user, $type, $messageTitle, $messageText, $endOfLifeTimeStamp)
Dependencies
To use Bootstrap toast for the notifications you have to embed Bootstrap manually.