定制 assaqqaf/zendesk-laravel-notification 二次开发

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

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

assaqqaf/zendesk-laravel-notification

Composer 安装命令:

composer require assaqqaf/zendesk-laravel-notification

包简介

Zendesk Notifications driver

README 文档

README

Software License Build Status StyleCI SensioLabsInsight Scrutinizer Code Quality Code Coverage Build Status

This package makes it easy to create Zendesk API with Laravel 5.3.

Contents

Installation

You can install the package via composer:

composer require assaqqaf/zendesk-laravel-notification

Add the service provider to config/app.php:

// config/app.php
'providers' => [
    ...
    NotificationChannels\Zendesk\ZendeskServiceProvider::class,
],

Setting up the Zendesk service

Add your Zendesk REST API Key to your config/services.php:

// config/services.php
...
'zendesk' => [
    'subdomin' => env('ZENDESK_API_SUBDOMIN'),
    'username' => env('ZENDESK_API_USERNAME'),
    'token' => env('ZENDESK_API_TOKEN'),
],
...

Usage

Now you can use the channel in your via() method inside the notification:

use NotificationChannels\Zendesk\ZendeskChannel;
use NotificationChannels\Zendesk\ZendeskMessage;
use Illuminate\Notifications\Notification;

class ProjectCreated extends Notification
{
    public function via($notifiable)
    {
        return [ZendeskChannel::class];
    }

    public function toZendesk($notifiable)
    {
        return
            (new ZendeskMessage('Test Zendesk Notification', 'This will be sent as ticket body'));
    }
}

In order to let your Notification know which user you are targeting, add the routeNotificationForZendesk method to your Notifiable model.

This method needs to return the access token of the authorized Evernote user.

public function routeNotificationForZendesk()
{
    return [
        'name' => $this->name,
        'email' => $this->email,
    ];
}

Available Message Methods

  • subject(''): Accepts a string value for the Zendesk ticket name.
  • description(''): Accepts a string value for the Zendesk ticket description.
  • content(''): Accepts a string value for the Zendesk ticket content message.
  • from('', ''): Accepts a string value for the Zendesk ticket requester name, and email.
  • type(''): Accepts a string value for the Zendesk ticket type. Allowed values are problem, incident, question, or task.
  • priority(''): Accepts a string value for the Zendesk ticket priority. Allowed values are urgent, high, normal, or low.
  • status(''): Accepts a string value for the Zendesk ticket status. Allowed values are new, open, pending, hold, solved or closed.
  • visible(): Set the comment to be public.
  • tags([]): Accepts an array value for the Zendesk ticket tags.
  • customField($id, $value): Set a new custom filed. Accept custom filed id as integer, and the value of the filed.
  • group(''): Accepts an integer as the group id, to assign ticket to this group.
  • ticket(): Accepts an integer as the ticket id. If thicket id is set, the notification will update this ticket.

Events

The package trigger and event when the ticket is created or updated. The following event is available:

  • NotificationChannels\Zendesk\Events\ZendeskTicketWasCreated
  • NotificationChannels\Zendesk\Events\ZendeskTicketWasUpdated

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固