nswdpc/silverstripe-taggable-notifications

Add tagging to notifications going out of a Silverstripe project

Installs: 89

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 1

Type:silverstripe-vendormodule

v0.3.0-rc3 2023-02-03 05:51 UTC

This package is auto-updated.

Last update: 2024-11-15 00:53:11 UTC


README

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).

Features

  • 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

Requirements

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.

User forms

If your project uses userforms, each Email recipient will get a tag field allowing per-recipient message tagging.

Installation

composer require silverstripe-taggable-notifications

License

BSD-3-Clause

Documentation

Configuration

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'

Maintainers

Add additional maintainers here and/or include authors in composer

Bugtracker

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.

Security

If you have found a security issue with this module, please email digital[@]dpc.nsw.gov.au in the first instance, detailing your findings.

Development and contribution

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.