A simple module supporting notification services that provide message tagging options (eg. Mailgun).
Depending on the service used, message tags be be used for message analytics, bottlenecks, rejection tracking and other failures (or successes).
- Project-level notification tags defined in configuration (optional)
- Tag limits (optional)
- A Trait for notification clients to use
- Userform extension to tag messages from a form, using
silverstripe/taxonomy
There are no special requirements for using this module beyond the composer requirements and the configuration required for your notification service.
To set tags on a notification that uses the Taggable trait:
$tags = ['tag1','tag2','tag3'];
$notifier->setNotificationTags( $tags );
For the core Email
class, configuration in the module sets TaggableEmail
as the Email class, via Injector.
$email = Injector::inst()->get( Email::class );
$email->setNotificationTags( $tags );
TaggableEmail will set headers on the Swift_Message
based on your configuration.
If your project uses a different email provider that supports tagging, it just needs to use the Taggable trait. Some examples exist in the documentation.
If your project uses userforms, each Email recipient will get a tag field allowing per-recipient message tagging.
composer require silverstripe-taggable-notifications
Add a project level tag. If provided, this is added to all notifications sent by the service.
---
Name: app-notification-tagging
After:
- '#nswdpc-taggable-notifications'
---
NSWDPC\Messaging\Taggable\ProjectTags:
tag: 'a-project-tag'
Add additional maintainers here and/or include authors in composer
We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.
Please review the code of conduct prior to opening a new issue.
If you have found a security issue with this module, please email digital[@]dpc.nsw.gov.au in the first instance, detailing your findings.
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.
Please review the code of conduct prior to completing a pull request.