nswdpc/silverstripe-taggable-notifications
为Silverstripe项目输出的通知添加标签
v0.3.0-rc3
2023-02-03 05:51 UTC
Requires
- silverstripe/framework: ^4.10.0
- silverstripe/tagfield: ^2
- silverstripe/taxonomy: ^2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- phpunit/phpunit: ^9.5
Suggests
- silverstripe/userforms: Install this module to get tagging of notifications from a user form
This package is auto-updated.
Last update: 2024-09-15 00:26:49 UTC
README
一个简单的模块,支持提供消息标签选项的通知服务(例如Mailgun)。
根据所使用的服务,消息标签可以用于消息分析、瓶颈、拒绝跟踪和其他失败(或成功)。
功能
- 配置中定义的项目级通知标签(可选)
- 标签限制(可选)
- 供通知客户端使用的Trait
- 使用
silverstripe/taxonomy
从表单标记消息的用户表单扩展
要求
除了composer的要求和您通知服务所需的配置之外,使用此模块没有特殊要求。
为使用Taggable trait的通知设置标签
$tags = ['tag1','tag2','tag3']; $notifier->setNotificationTags( $tags );
对于核心Email
类,模块中的配置通过注入器将TaggableEmail
设置为Email类。
$email = Injector::inst()->get( Email::class ); $email->setNotificationTags( $tags );
TaggableEmail将根据您的配置在Swift_Message
上设置标题。
如果您的项目使用支持标记的不同电子邮件提供程序,只需使用Taggable trait即可。一些示例在文档中。
用户表单
如果您的项目使用用户表单,每个电子邮件收件人将获得一个标签字段,允许按收件人标记消息。
安装
composer require silverstripe-taggable-notifications
许可证
文档
配置
添加项目级标签。如果提供,则将其添加到服务发送的所有通知中。
--- Name: app-notification-tagging After: - '#nswdpc-taggable-notifications' --- NSWDPC\Messaging\Taggable\ProjectTags: tag: 'a-project-tag'
维护者
在此处添加其他维护者,或包含作者到composer
错误跟踪器
我们欢迎在GitHub问题跟踪器上为该项目提交错误报告、pull请求和功能请求。
在打开新问题之前,请先查看行为准则。
安全性
如果您发现此模块存在安全问题,请首先通过电子邮件digital[@]dpc.nsw.gov.au详细说明您的发现。
开发和贡献
如果您想为此模块做出贡献,请确保提出pull请求并与模块维护者进行讨论。
在完成pull请求之前,请先查看行为准则。