Giter VIP home page Giter VIP logo

notification's Introduction

Test Develop Stable

Notification

Notification banner

This is the public repository for Notification - the WordPress plugin.

This plugin allow you to send custom notifications about various events in WordPress. It also comes with simple yet powerful API by which you can add literally any trigger action.

By default it supports Email, Webhook and Webhook plain JSON notifications.

Default Triggers

Comment, Pingback, Trackback and Custom Comment Type

This covers all the comment types. Use comment, pingback, trackback, another_comment_type instead of the {comment_type_slug}.

Trigger name Trigger slug
Comment added comment/{comment_type_slug}/added
Comment approved comment/{comment_type_slug}/approved
Comment replied comment/{comment_type_slug}/replied
Comment spammed comment/{comment_type_slug}/spammed
Comment trashed comment/{comment_type_slug}/trashed
Comment unapproved comment/{comment_type_slug}/unapproved
Comment published comment/{comment_type_slug}/published
Media
Trigger name Trigger slug
Media added media/added
Media trashed media/trashed
Media updated media/updated
Plugin
Trigger name Trigger slug
Plugin activated plugin/activated
Plugin deactivated plugin/deactivated
Plugin installed plugin/installed
Plugin removed plugin/removed
Plugin updated plugin/updated
Post, Page and Custom Post Type

This covers all the custom post types, as well. Use post, page, product, another_post_type instead of the {post_type_slug}.

Trigger name Trigger slug
Post added post/{post_type_slug}/added
Post saved as a draft post/{post_type_slug}/drafted
Post sent for review post/{post_type_slug}/pending
Post approved post/{post_type_slug}/approved
Post published post/{post_type_slug}/published
Post trashed post/{post_type_slug}/trashed
Post updated post/{post_type_slug}/updated
Post scheduled post/{post_type_slug}/scheduled
Category, Tag and Custom Taxonomy

This covers all the taxonomies. Use category, post_tag, another_taxonomy instead of the {taxonomy_slug}.

Trigger name Trigger slug
Taxonomy term created taxonomny/{taxonomy_slug}/created
Taxonomy term deleted taxonomny/{taxonomy_slug}/deleted
Taxonomy term updated taxonomny/{taxonomy_slug}/updated
Theme
Trigger name Trigger slug
Theme installed theme/installed
Theme switched theme/switched
Theme updated theme/updated
User
Trigger name Trigger slug
User deleted user/deleted
User login user/login
User login failed user/login_failed
User logout user/logout
User password changed user/password_changed
User password reset request user/password_reset_request
User profile updated user/profile_updated
User role changed user/role_changed
WordPress
Trigger name Trigger slug
Available updates wordpress/updates_available
Privacy
Trigger name Trigger slug
Personal Data erased privacy/data-erased
Personal Data erase request privacy/data-erase-request
Personal Data exported privacy/data-exported
Personal Data export request privacy/data-export-request

Extensibility

The Notification plugin have multiple APIs which gives you the ability to customize the plugin. The most important ones are:

  • Trigger API - you can wrap any WordPress' do_action into a Trigger.
  • Carrier API - you can register a custom Carrier, like a service connection. Carriers are independent from Triggers and works with all default and custom Triggers out of the box. It's packed with configuration form builder.
  • Recipient API - you can register a custom Recipients for your Carriers. Like automatically pulled users from external database or simply custom user query with meta etc.
  • Resolver API - you can create another Merge Tag resolver, ie. {customtag param1} which is handled differently than a standard Merge Tag.
  • Settings API - for quick plugin Settings registration

Bundling the plugin

You can ship this plugin as a part of your plugin or theme. Just copy the plugin directory into your folder and require load.php file. Read more about the plugin bundling and plugin loading stack.

White labeling

You can integrate this plugin with your system with a simple white labeling, it's a single notification_whitelabel() function to call. Read the full white labeling documentation.

Quick links

Development version

You can download build development version from the Development workflow. Click the latest run and download generated artifact.

notification's People

Contributors

aniaszlkwcz avatar bracketspaceworker avatar dartui avatar dependabot[bot] avatar gbiorczyk-mateusz avatar insejn avatar jakubmikita avatar jasynecka avatar jbcsu avatar jclausen avatar jnorell avatar kl3sk avatar kryswoj avatar kuzry avatar martinellimarco avatar mathetos avatar matthewnie avatar max-kk avatar mircobabini avatar smanczak avatar szaleq avatar szepeviktor avatar zebfross avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notification's Issues

500 error

when i activate the plugin, it breaks wordpress with error 500.. any idea what is wrong? would love to use this plugin! thanks

Contextual help

Would be good to add some contextual help, like the one you can see after installing Yoast SEO.

register_trigger and default recipients

Hi Kuba,

I was tried to set the default "recipients" but can't figure out correct way to do this.

First example (admin notification):

$triggers['fv/competitor/to-admin/uploaded'] = array(
    'slug'     => 'fv/competitor/to-admin/uploaded',
    'name'     => __( 'New competitor submitted', 'fv' ),
    'group'    => '****(to admin)',
    'template' => $this->_get_notification_template('fv/competitor/to-admin/uploaded'),
    'tags'     => $this->_get_admin_default_tags(),
    'recipients' => array(
        'recipient_type_slug' => 'administrator',
        //'administrator'       => true,
    )
);

Problem: nothing happens

Second example (default - merge tag):

$triggers['fv/competitor/to-user/uploaded'] = array(
    'slug'     => 'fv/competitor/to-user/uploaded',
    'name'     => __( 'Competitor successful submitted', 'fv' ),
    'group'    => '*** (to user)',
    'template' => $this->_get_notification_template('fv/competitor/to-user/uploaded'),
    'tags'     => $this->_get_user_default_tags(),
    'recipients' => array(
        //'recipient_type_slug' => 'merge_tag',
        'merge_tag'           => 'competitor_user_email',
    )
);

Problem: by default Merge Tag type is selected but no one Merge Tag is selected and list is empty (example)

Thanks

Constantly alert when writing

I have a notification with the trigger "Post published", but get constantly an email. Once the draft, or every time the post/draft is saved, i become a email notification. Not only when the post was published.

Current WordPress- and Plugin-Version

Sorry for my bad english

Custom post type not showing on settings page

I am trying to add a notification for my custom post type called 'message', but it isn't showing in the post types list on the settings page. Only Page and Post are showing but i have a few other custom post types as well. Any ideas why? Thanks

NextGen Gallery code being sent with notification

I notice when I send an email that the NextGen Gallery code is sent along with the post_content. Is there a way to disable this?
[ngg_images source="galleries" container_ids="270" display_type="photocrati-nextgen_pro_masonry" size="180" padding="10" display_type_view="default" ngg_triggers_display="always" captions_enabled="0" captions_display_sharing="1" captions_display_title="1" captions_display_description="1" captions_animation="slideup" order_by="sortorder" order_direction="ASC" returns="included" maximum_entity_count="300"]

Thank you.

Notifications working for certain users

I am using Notifications to send email notifications on the creation and publication of a custom post type. And it's pretty awesome. But I am running into an issue with a custom created user.

The custom post type can be created by two types of users: Administrators and a Custom User.

I have two notifications set up:
1.) Alert by email when a new post has been submitted for review and
2.) Alert post creator when their post has been published.

Both alerts work if the custom post creator is logged in as Administrator - emails are received for both alerts: submit for review and publish. But if the posts are created by a custom user the first alert does not work. They do receive the 2nd alert (when their content has been published).

Do I need to adjust settings somewhere to recognize the custom user?

Any guidance is much appreciated. Thank you.

Merge tags translations

I think there should be a way to translate (or describe) merge tags. This would be a huge help for non english users.

Add conditial tags

Hi Kuba,

How about adding some conditial tags like IF?

There is a working example:

   
add_action( 'notification/notify/pre/message', 'pre_message__filter3', 10, 3 );

function pre_message__filter3($message, $trigger, $tags) {
            $matches = array();

            preg_match_all('/\[IF \{([^\}]*)\}\](.[^\]]+)(?:\[ELSE\](.+?))?\[ENDIF\]/s', $message, $matches);

            if ( empty($matches) ) {
                return $message;
            }

            $math_tag = '';
            foreach ( $matches[0] as $m_index => $match )
            {
                $math_tag =  trim($matches[1][$m_index]);

                if ( !empty($tags[$math_tag]) ) {
                    // IF value is not empty
                    $message = str_replace($match, $matches[2][$m_index], $message);
                } elseif( empty($tags[$math_tag]) && $matches[3][$m_index] ) {
                    // ELSE
                    $message = str_replace($match, $matches[3][$m_index], $message);
                } else {
                    // IF NO ELSE condition - REMOVE ALL
                    $message = str_replace($match, '', $message);
                }
            }

            return $message;
}

Example:

[IF {post_content}]Post content is filled![ENDIF]
[IF {post_content}]Post content is filled![ELSE]{post_content}[ENDIF]

Regards, Max

Multisite support

Example: email notification to Network Admin each time a new post is created on any site in the network

When plugin is enabled I lose access to private publishing

Let me state that I love this plugin, however, I noticed as of late that when this is enabled, I am unable to save a post or page as private. I've gone through every plugin and when I disabled this, I regained the ability. Testing this several time, resulted in the same result.

I'd love to help correct this, if this wasn't already reported. I've used this on wordpress 4.7, with plugin versions 2.4 and 3.0.

Thank you

Double link issue

When adding merge tag as a link TinyMCE is doing http://{tag} link.

Comment trigger Akismet compat.

There should be an option to send comment notification AFTER it's processed by Akismet filters.

Feature proposed by Nels Johnson

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.