mblsolutions/paypoint-sendgrid-notification 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mblsolutions/paypoint-sendgrid-notification

最新稳定版本:v1.0.2

Composer 安装命令:

composer require mblsolutions/paypoint-sendgrid-notification

包简介

PayPoint Sendgrid Notification package

README 文档

README

PayPoint sendgrid notification package

Installation

The recommended method to install LaravelRepository is with composer

php composer require mblsolutions/paypoint-sendgrid-notification

Laravel without auto-discovery

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

\MBLSolutions\SendgridNotification\SendgridNotificationServiceProvider::class,

Package configuration

Copy the package configuration to your local config directory.
php artisan vendor:publish --tag=sendgrid-notification-config

Database Driver

If you would like to use the Database driver to store your notification logs, you will first need to create and run the database driver migration.

php artisan paypoint-sendgrid-notification:database:table

This will create a new migration in database/migrations, after creating this migration run the database migrations to create the new table.

php artisan migrate

Usage

The configuration and setup can be adjusted in the notification config file located in config/notification.php. We recommend reading through the config file before enabling notification to ensure you have the optimum setup.

Enable Notification Service

In environment setting, you need to change MAIL_MAILER from smtp to sendgrid to enable the service. The credentials is neede to add in your .env file.

MAIL_MAILER=sendgrid
SENDGRID_DSN=sendgrid+api://[SECRET_KEY]@default
#mblsolutions will be sat by default if .env is not sat in the below
SENDGRID_EMAIL_IDENTIFIER=mblsolutions

In mail setting, you need to add sendgrid in mailer.

'mailers' => [
    //... other mailer
    'sendgrid' => [
        'transport' => 'sendgrid',
        'dsn' => env('SENDGRID_DSN'),
    ],
]

Enable user information for logging in job

If you would like to have user information in notification logs, you need to set user in authentication as in the example below:

class SendEmail extends Notification implements ShouldQueue
{
    use HasAuthUser; //This trait is used to assign the auth user
    
    public function __construct()
    {
        $this->initAuthUser(); //needs to init $authUser
    }

    public function toMail($notifiable): SendgridMailMessage
    {
        //constructor MailMessage with $authUser
        return (new SendgridMailMessage(($this->authUser)));
    }
}

License

Notification is free software distributed under the terms of the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2025-08-28