定制 ironbound/wp-notifications 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ironbound/wp-notifications

最新稳定版本:v1.0.1

Composer 安装命令:

composer require ironbound/wp-notifications

包简介

Drop in framework for sending notifications in WordPress.

README 文档

README

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

Basic Usage

WP Notifications is easy, and straightforward to use.

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

Queues

  • WP_Cron
  • Mandrill

Installation

First, add WP Notifications as a dependency with Composer:

composer require ironbound/wp-notifications

Then, make sure your bootstrap file is loading the composer autoloader:

require_once 'vendor/autoload.php';

License

MIT

统计信息

  • 总下载量: 306
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-05