heimrichhannot / contao-entity_notifyer
A backend module for sending notifications if an entity hasn't been changed in a while.
Installs: 29
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 0
Open Issues: 0
Type:contao-module
Requires
- php: ~5.4 || ~7.0
- contao-community-alliance/composer-plugin: ~2.4 || ~3.0
- contao/core-bundle: ^3.5.1 || ~4.1
- heimrichhannot/contao-observer: >=1.2.0
- terminal42/notification_center: >=1.3.10
This package is not auto-updated.
Last update: 2024-10-27 06:07:57 UTC
README
This module is used to send a notification for the subject that an entity hasn't been changed in a while.
Technical instruction
set up the entity_notifyer
Step 1
- create a new observer in heimrichhannot\contao-observer backend module
- select
entity_notification
as subject in the observer config - select a dataContainer
- select
entity_inactive_notifcation
as observer in the observer config - set criteria on which the notification should be send
Step 2
- create a new entity_notification in heimrichhannot\contao-entity_notifyer backend module
- select an previously defined observer
- choose a notification that should be send when the criteria set in the observer is fullfilled
optional
-
enable the backend user to exclude an entity from the entity notifyer (e.g. this could come to use when a notification has been send a couple of times for that entity and you don't want to get more)
-
add
excludeFromEntityNotifyer
field to dca which you want to exclude from the notification
\HeimrichHannot\EntityNotifyer\Backend\EntityNotifyerHelper::addExcludeField('tl_member');
- add the
operation
to the dca
$dc['list']['operations'][\HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE_FROM_OBSERVER] = [
'label' => &$GLOBALS['TL_LANG']['OBSERVER'][\HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE][0],
'title' => &$GLOBALS['TL_LANG']['OBSERVER'][\HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE][1],
'href' => 'key=' . \HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE,
'icon' => 'system/modules/entity_observer/assets/img/_icon.png',
'button_callback' => [
'HeimrichHannot\EntityObserver\Backend\EntityObserverHelper',
\HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE_FROM_OBSERVER
]
];
- add the operation in the
config.php
// exclude from entity_notifyer
$GLOBALS['BE_MOD']['accounts']['member'][\HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE] =
['HeimrichHannot\EntityNotifyer\Backend\EntityNotifyerHelper', \HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_EXCLUDE];
// include to entity_notifyer
$GLOBALS['BE_MOD']['accounts']['member'][\HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_INCLUDE] =
['HeimrichHannot\EntityNotifyer\Backend\EntityNotifyerHelper', \HeimrichHannot\EntityNotifyer\Entity::ENTITY_NOTIFYER_INCLUDE];
- you can now exclude/include an entity from the functionality of entity_notifyer at the backend entity