承接 digitalrisks/hubspot-notification-channel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

digitalrisks/hubspot-notification-channel

最新稳定版本:v2.0

Composer 安装命令:

composer require digitalrisks/hubspot-notification-channel

包简介

Hubspot Notification Channel for laravel.

README 文档

README

This package makes it easy to send Hubspot (Single Send Email) notifications with Laravel.

Installation

You can install the package via composer:

composer require digitalrisks/hubspot-notification-channel

Add the service provider (only required on Laravel 5.4 or lower):

// config/app.php
'providers' => [
    ...
    DigitalRisks\Notifications\ServiceProvider::class,
],

Setting up your Hubspot account

Add your Hubspot key to your config/services.php:

// config/services.php
...
'hubspot' => [
    'app_access_token' => env('HUBSPOT_APP_ACCESS_TOKEN', null),
    'template_id' => env('TEMPLATE_NAME_ID', null)
],
...

Usage

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

<?php

namespace App\Notifications;

use DigitalRisks\Notifications\Messages\HubspotMessage;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;

class SomethingHappened extends Notification
{
    use Queueable;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['hubspot'];
    }

    /**
     * Get the hubspot representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \DigitalRisks\Notifications\Messages\HubspotMessage
     */
    public function toMail($notifiable)
    {
        return (new HubspotMessage)
            ->templateId(config('services.hubspot.template_id'))
            ->contactProperties([])
            ->customProperties([]);
    }
}

Setting up the to field.

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;
    
    /**
     * Route notifications for the Hubspot channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForHubspot($notification)
    {
        return $this->email;
    }
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email kani.robinson@digitalrisks.co.uk instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固