该包已被弃用且不再维护。未建议替代包。

Evernote 通知驱动程序

1.0.0 2016-08-23 21:30 UTC

This package is auto-updated.

Last update: 2019-10-21 00:31:49 UTC


README

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

已弃用通道

请参阅 此问题 了解更多信息。
由于缺乏维护者,此通道于2019年10月被弃用。

此包可以轻松使用 Laravel 5.3 创建 Evernote 笔记。

内容

安装

您可以通过 composer 安装此包

composer require laravel-notification-channels/evernote

设置 Evernote 服务

为了向 Evernote 用户添加票据,您需要获取他们的访问令牌。

创建一个沙盒 Evernote API 密钥 以开始。

为了简化开发,您还可以生成自己的 个人开发访问令牌

使用方法

现在您可以在通知中的 via() 方法内使用此通道

use NotificationChannels\Evernote\EvernoteChannel;
use NotificationChannels\Evernote\EvernoteContent;
use NotificationChannels\Evernote\EvernoteMessage;
use Illuminate\Notifications\Notification;

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

    public function toEvernote($notifiable)
    {
        return EvernoteMessage::create('Evernote message title')
                    ->sandbox()
                    ->content(EvernoteContent::create('Evernote content is here'))
                    ->tags(['Laravel','Notifications'])
                    ->reminder('tomorrow');
    }
}

为了让您的通知知道您针对哪个 Evernote 用户,请将 routeNotificationForEvernote 方法添加到您的可通知模型中。

此方法需要返回授权 Evernote 用户的访问令牌。

public function routeNotificationForEvernote()
{
    return 'NotifiableAccessToken';
}

可用的消息方法

  • title(''):接受一个字符串作为 Evernote 票据标题。
  • content(EvernoteContent):接受一个 EvernoteContent 对象。
  • sandbox():启用 Evernote 沙盒模式(默认 false)。
  • done():将 Evernote 票据标记为完成。
  • tags(''):接受一个数组,用于向 Evernote 票据添加标签。
  • reminder(''):接受一个字符串或 DateTime 对象作为 Evernote 票据提醒。

可用的内容方法

  • content(''):接受一个字符串值作为 Evernote 票据内容。
  • html():设置内容类型为 HTML。
  • plain():设置内容类型为纯文本(默认)。

变更日志

请参阅 CHANGELOG 了解最近更改的详细信息。

测试

$ composer test

安全

如果您发现任何与安全相关的问题,请通过电子邮件发送至 m.pociot@gmail.com,而不是使用问题跟踪器。

贡献

请参阅 CONTRIBUTING 了解详情。

致谢

许可

MIT 许可证(MIT)。请参阅 许可文件 获取更多信息。