LogoLogo
WordPress.orgExtensionsSupport
Version 6
Version 6
  • Notification – Custom Notifications and Alerts for WordPress
  • Known issues
  • User guide
    • How Notification plugin works
    • Who can use this plugin
    • How to create Notifications
    • Custom Post Type support
    • How to escape { character
    • Background processing
    • Troubleshooting
    • How to setup different FROM address for different Notifications
  • Developer
    • General
      • Plugin loading chain
      • Extension possibilities
      • Creating an extension
      • Bundling Notification plugin
      • White label mode
    • Notifications
      • Suppressing the Notification
      • JSON synchronization
      • Programmatic Notifications
    • Triggers
      • List of all default Triggers
      • Custom Trigger
      • Enable support for non-public Custom Post Type
      • Adding Merge Tags to existing Triggers
      • Postponing the Trigger action
      • Delaying Trigger execution with Cron
    • Carriers
      • Suppressing the Carrier
    • Snippets
      • General
        • Automatic Trigger testing
        • Allow other roles to edit Notifications
      • Triggers
        • Post
        • User
      • Integations
        • WP All Import
        • MemberPress
        • Gutenberg
  • Extensions
    • Installation
    • Planned extensions
    • 3rd Party Extensions
    • Custom Fields
    • Scheduled Triggers
Powered by GitBook
On this page
  • Modular components
  • Carrier
  • Trigger
  • Merge Tag
  • Recipient
  • Summary

Was this helpful?

  1. Developer
  2. General

Extension possibilities

PreviousPlugin loading chainNextCreating an extension

Last updated 6 years ago

Was this helpful?

The Notification plugin has a great, powerful developer API which allows you to extend it nearly limitless.

Take a look at to search for actions and filters you can use, but also to see how the default things are registered.

Modular components

Carrier

By default, plugin supports the Email and Webhook carriers, but it can be anything. You can even send real paper letters with it as long as you have service provider and API access for it.

The best part is that you can create any form fields, including repeatable fields. All using very simple API.

To register new Carrier you want to use notification_register_carrier function.

Trigger

The trigger is a class which handles the action you want to hook in. Because it utilizes the WordPress actions system, you can hook up to anything you want! Even a page refresh, but this would probably kill your server.

To register new Trigger you want to use notification_register_trigger function.

Merge Tag

This is a tiny bit of code which replaces things like {this} to This. With them, you can create dynamic parts of the Notification. An example is {post_permalink} Merge Tag used in Post published Trigger.

There are few very basic Merge Tag types, like String, Integer, URL etc. but we have also more specific ones, like User Email. You can use them too!

The configuration couldn’t be simpler. You just have to define a property with needed information in the Trigger class and that’s it.

If you wish to add some more Merge tags to existing Triggers – that’s not a problem.

If you wish to add completely new Merge tags – that’s not a problem too.

Recipient

The recipient is also represented by a class. It’s not obligatory to use them with any custom Notification, but it’s highly recommended to keep unified interface of the plugin.

Also, it provides a value parser which automatically changes saved values to values which are understood by your Notification. For example, the Email Notification has Recipients. In the database, we are storing user IDs and with Recipient class they are automatically changed to an email address.

Summary

I hope this will give you a nice idea how you can extend Notification plugin by yourself.

In the WordPress admin, we have also an Extensions screen. We’ll be happy to put your extensions there!

To register new Recipient you want to use function.

plugin’s repository at Github
register_recipient()