承接 kientran/aws-pinpoint-laravel-notification-channel-fork-support-laravel-9 相关项目开发

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

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

kientran/aws-pinpoint-laravel-notification-channel-fork-support-laravel-9

Composer 安装命令:

composer require kientran/aws-pinpoint-laravel-notification-channel-fork-support-laravel-9

包简介

Send notifications using AWS Pinpoint

README 文档

README

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

This package makes it easy to send notifications using AwsPinpoint with Laravel 5.5+ and 6.0.

Note: Currently only SMS is supported. Other message types like voice and email are on the roadmap. Please get in touch if you would like to help out with this.

Send SMS using AWS Pinpoint the easy way.

Contents

Installation

You can install the package via composer by running the command below

composer require kielabokkie/aws-pinpoint-laravel-notification-channel

Setting up the AwsPinpoint service

This package uses the AWS Service Provider for Laravel package. You'll need to add specific configuration for AWS Pinpoint to your config/aws.php file. See the example below:

...
'Pinpoint' => [
    'region' => env('AWS_PINPOINT_REGION'),
    'application_id' => env('AWS_PINPOINT_APPLICATION_ID'),
    'sender_id' => env('AWS_PINPOINT_SENDER_ID'),
    'key' => env('AWS_PINPOINT_KEY'),
    'secret' => env('AWS_PINPOINT_SECRET'),
],
...

And then add the following entries in your .env file:

...
AWS_PINPOINT_REGION=
AWS_PINPOINT_APPLICATION_ID=
AWS_PINPOINT_SENDER_ID=
AWS_PINPOINT_KEY=
AWS_PINPOINT_SECRET=
...

Usage

Once everything is setup you can send a notification as follows:

<?php

namespace App\Notifications;

use App\User;
use Illuminate\Notifications\Notification;
use NotificationChannels\AwsPinpoint\AwsPinpointChannel;
use NotificationChannels\AwsPinpoint\AwsPinpointSmsMessage;

class PhoneVerificationCreated extends Notification
{
    /**
     * Get the notification's delivery channels.
     *
     * @param \App\User $notifiable
     * @return array
     */
    public function via(User $notifiable)
    {
        return [AwsPinpointChannel::class];
    }

    /**
     * Send SMS via AWS Pinpoint.
     *
     * @param \App\User $notifiable
     * @return \NotificationChannels\AwsPinpoint\AwsPinpointSmsMessage
     */
    public function toAwsPinpoint(User $notifiable)
    {
        $message = sprintf('Your order %s has been dispatched', $this->orderId);

        return (new AwsPinpointSmsMessage($message))
            ->setRecipients($notifiable->mobile_number);
    }
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email kielabokkie@gmail.com instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 59
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固