webpress / notification
此软件包的最新版本(3.1.87)没有提供许可证信息。
Webpress附加通知功能软件包
3.1.87
2021-10-05 08:29 UTC
Requires
- webpress/core: ^3.1
Requires (Dev)
- orchestra/testbench: 5.0.0
- phpunit/phpunit: 8.5.13
- spatie/phpunit-watcher: 1.23.0
- dev-master
- 3.1.87
- 3.1.86
- 3.1.85
- 3.1.83
- 3.1.82
- 3.1.81
- 3.1.80
- 3.1.79
- 3.1.78
- 3.1.77
- 3.1.76
- 3.1.74
- 3.1.73
- 3.1.72
- 3.1.71
- 3.1.70
- 3.1.69
- 3.1.68
- 3.1.67
- 3.1.66
- 3.1.65
- 3.1.64
- 3.1.63
- 3.1.61
- 3.1.60
- 3.1.59
- 3.1.58
- 3.1.57
- 3.1.56
- 3.1.54
- 3.1.53
- 3.1.52
- 3.1.51
- 3.1.50
- 3.1.49
- 3.1.48
- 3.1.47
- 3.1.46
- 3.1.45
- 3.1.44
- 3.1.43
- 3.1.42
- 3.1.41
- 3.1.40
- 3.1.39
- 3.1.38
- 3.1.37
- 3.1.36
- 3.1.35
- 3.1.34
- 3.1.33
- 3.1.32
- 3.1.31
- 3.1.30
- 3.1.29
- 3.1.28
- 3.1.27
- 3.1.26
- 3.1.25
- 3.1.24
- 3.1.23
- 3.1.22
- 3.1.20
- 3.1.19
- 3.1.18
- 3.1.17
- 3.1.15
- 3.1.14
- 3.1.13
- 3.1.12
- 3.1.11
- 3.1.10
- 3.1.9
- 3.1.8
- 3.1.7
- 3.1.6
- 3.1.5
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.34
- 3.0.33
- 3.0.32
- 3.0.31
- 3.0.30
- 3.0.29
- 3.0.28
- 3.0.27
- 3.0.26
- 3.0.25
- 3.0.24
- 3.0.23
- 3.0.22
- 3.0.21
- 3.0.20
- 3.0.19
- 3.0.18
- 3.0.17
- 3.0.16
- 3.0.15
- 3.0.14
- 3.0.13
- 3.0.12
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.6
- 3.0.5
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.1
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.0.2
- 0.0.1
- dev-dev/v9.0
- dev-develop
This package is auto-updated.
Last update: 2022-06-17 10:31:25 UTC
README
laravel webpress 核心的通知渠道
安装
要将此软件包包含到您的项目中,请运行以下命令。
composer require webpress/notification
配置
运行以下命令以发布配置和迁移文件。
php artisan vendor:publish --provider="VCComponent\Laravel\Notification\Providers\NotificationServiceProvider"
环境
在 .env
文件中,我们需要进行一些配置。
// Communication microservice url
WEBPRESS_NOTIFICATION_BASE_URL=https://api.dev.webpress.vn/communication
通知渠道
Webpress 通知渠道
一个支持通过 Webpress 通信微服务发送电子邮件的通知渠道(目前使用 Mailchimp 交易 API)。
在通知类中使用此渠道,类似于其他默认的 Laravel 通知渠道。
use VCComponent\Laravel\Notification\Notifications\Channels\WebpressChannel; public function via($notifiable) { return [WebpressChannel::class]; }
在 toWebpress()
方法中定义消息。
use VCComponent\Laravel\Notification\Notifications\Messages\WebpressMessage; public function toWebpress($notifiable) { return (new WebpressMessage()) ->to($notifiable->email) ->subject('Reset Password') ->template('WEBPRESS 01 - reset your password') ->mergeFields([ [ 'name' => 'RESET_PASSWORD_URL', 'content' => "{$reset_password_url}?token={$this->token}", ], ]); }
API 列表
以下是软件包提供的 API 列表。
动词 | URI | 操作 |
---|---|---|
GET | /api/{namespace}/notification-setting/configable |
获取用户的可配置通知 |
GET | /api/{namespace}/notification-setting |
获取用户的通知设置 |
PUT | /api/{namespace}/notification-setting/sync |
更新用户的通知设置 |
------ | ------ | ------ |
GET | /api/{namespace}/admin/notifications |
获取通知列表 |
GET | /api/{namespace}/admin/notifications/{id} |
获取一个通知 |
POST | /api/{namespace}/admin/notifications |
创建一个通知 |
PUT | /api/{namespace}/admin/notifications/{id} |
更新一个通知 |
DELETE | /api/{namespace}/admin/notifications/{id} |
删除一个通知 |
------ | ------ | ------ |
GET | /api/{namespace}/admin/template-variables |
获取模板变量列表 |
GET | /api/{namespace}/admin/template-variables/{id} |
获取一个模板变量 |
POST | /api/{namespace}/admin/template-variables |
创建一个模板变量 |
PUT | /api/{namespace}/admin/template-variables/{id} |
更新一个模板变量 |
DELETE | /api/{namespace}/admin/template-variables/{id} |
删除一个模板变量 |
------ | ------ | ------ |
GET | /api/{namespace}/admin/notification-setting/role/{role_id} |
获取角色通知设置 |
PUT | /api/{namespace}/admin/notification-setting |
更新角色模板变量 |