heimrichhannot / contao-entity_notifyer
一个后端模块,用于在实体一段时间内未被更改时发送通知。
1.0.2
2018-03-12 08:42 UTC
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-09-15 05:28:44 UTC
README
此模块用于向主题发送通知,表示实体一段时间内未被更改。
技术说明
设置实体通知器
步骤 1
- 在 heimrichhannot\contao-observer 后端模块中创建一个新的观察者
- 在观察者配置中选择
entity_notification
作为主题 - 选择一个数据容器
- 在观察者配置中选择
entity_inactive_notifcation
作为观察者 - 设置发送通知的准则
步骤 2
- 在 heimrichhannot\contao-entity_notifyer 后端模块中创建一个新的 entity_notification
- 选择之前定义的观察者
- 选择当观察者中设置的准则满足时应该发送的通知
可选
-
允许后端用户从实体通知器中排除实体(例如,当该实体已发送几次通知时,您不想再收到更多时,这可能很有用)
-
将
excludeFromEntityNotifyer
字段添加到您想排除通知的 dca 中
\HeimrichHannot\EntityNotifyer\Backend\EntityNotifyerHelper::addExcludeField('tl_member');
- 将操作添加到 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
]
];
- 将操作添加到
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];
- 您现在可以在后端实体中排除/包含实体,以从实体通知器的功能中排除/包含实体