derjacques/laravel-pipedrive-notification-channel

允许Laravel站点向Pipedrive发送通知

2.1.1 2017-09-07 14:38 UTC

This package is not auto-updated.

Last update: 2024-09-27 22:56:45 UTC


README

Latest Version on Packagist Software License Build Status Code Coverage Quality Score StyleCI

Laravel Pipedrive通知通道

一个简单的Laravel通知系统Pipedrive驱动程序。

功能

目前,此包允许您轻松创建和更新以下Pipedrive资源

  • 交易
  • 活动
  • 笔记

这些资源可以轻松关联,因此您可以通过一个简单操作创建交易并附加活动或笔记。

如何使用

为了安装,只需使用composer

$ composer require derjacques/laravel-pipedrive-notification-channel

以下是使用通知通道的完整示例

// app/Notifications/ExampleNotification

use DerJacques\PipedriveNotifications\PipedriveChannel;
use DerJacques\PipedriveNotifications\PipedriveMessage;

class ExampleNotification extends Notification
{

    public function via($notifiable)
    {
        return [PipedriveChannel::class];
    }

    public function toPipedrive($notifiable)
    {
        return
            (new PipedriveMessage())
                ->deal(function ($deal) {
                    $deal->stage(1)
                         ->title('new deal')
                         ->activity(function ($activity) {
                             $activity->subject('Call Jane')
                                      ->type('call');
                         })
                         ->activity(function ($activity) {
                             $activity->id(3)
                                      ->subject('Email Joe')
                                      ->type('mail');
                         })
                         ->note(function ($note) {
                             $note->content('Link to deal');
                         });
                })
                ->activity(function ($activity) {
                    $activity->subject('Buy milk')
                             ->type('shopping')
                             ->due('2017-12-18');
                });
    }
}
// app/User.php

public function routeNotificationForPipedrive()
{
    return 'YOUR-PIPEDRIVE-KEY';
}