2017 © Pedro Peláez
 

library wp-notifications

Drop in framework for sending notifications in WordPress.

image

ironbound/wp-notifications

Drop in framework for sending notifications in WordPress.

  • Monday, October 5, 2015
  • by TimothyBJacobs
  • Repository
  • 1 Watchers
  • 0 Stars
  • 280 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

WP Notifications

WP Notifications is a drop in framework for sending notifications with WordPress. It supports multiple sending strategies and batch processing via queues., (*1)

Basic Usage

WP Notifications is easy, and straightforward to use., (*2)

Sending a single notification

$recipient = wp_get_current_user();
$manager = Factory::make( 'your-notification' );
$message = "Hey {first_name}, how's it going?";
$subject = "Hey!"

$notification = new Notification( $recipient, $manager, $message, $subject );
$notification->set_strategy( new WP_Mail() )->send();

Sending multiple notifications

$queue = new WP_Cron( new Options_Storage( 'your-project-name' ) );
$queue->process( $notifications, new WP_Mail() );

Setting up template tag listeners

add_action( 'ibd_wp_notifications_template_manager_your-notification', function( Manager $manager ) {
    // a template tag of {first_name} will be automatically replaced 
    // with the recipient's first name when sending.
    $manager->add_listener( new Listener( 'first_name', function( WP_User $recipient ) {
        return $recipient->first_name;
    } ) );
} );

Supports

Strategies - WP_Mail - iThemes Exchange - Easy Digital Downloads - Mandrill, (*3)

Queues - WP_Cron - Mandrill, (*4)

Installation

First, add WP Notifications as a dependency with Composer:, (*5)

composer require ironbound/wp-notifications

Then, make sure your bootstrap file is loading the composer autoloader:, (*6)

require_once 'vendor/autoload.php';

License

MIT, (*7)

The Versions

05/10 2015

dev-master

9999999-dev

Drop in framework for sending notifications in WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

05/10 2015

v1.0.1

1.0.1.0

Drop in framework for sending notifications in WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

05/10 2015

v1.0

1.0.0.0

Drop in framework for sending notifications in WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.3.0