Extension possibilities

Use the Extension boilerplate for a quickstart.

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

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

Notification

This is actual notification “gate”. By default, plugin supports the Email and Webhook notifications, 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 Notification you want to use register_notification() 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 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 tags 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.

To register new Recipient you want to use register_recipient() function.

 


 

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!

2 people considered this helpful