aiqedge/smtp-notifications-channel 问题修复 & 功能扩展

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

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

aiqedge/smtp-notifications-channel

Composer 安装命令:

composer require aiqedge/smtp-notifications-channel

包简介

Laravel Notification Channel for the AIQEDGE-SMTP service.

README 文档

README

A Laravel notification channel for sending emails via the AIQEDGE SMTP API. This package lets you deliver notifications using AIQEDGE's SMTP service, making it easy to integrate external email delivery into your Laravel applications.

Features

  • Send notifications through AIQEDGE SMTP API
  • Simple integration with Laravel's notification system
  • Error logging for failed requests

Installation

Install the package via Composer:

composer require aiqedge/smtp-notifications-channel

Configuration

Add your AIQEDGE SMTP credentials to your .env file:

AIQEDGE_SMTP_KEY=your-api-key-here
AIQEDGE_SMTP_URL=https://api.aiqedge.com/smtp

Then, add the following to your config/services.php:

'aiqedge_smtp' => [
    'key' => env('AIQEDGE_SMTP_KEY'),
    'url' => env('AIQEDGE_SMTP_URL'),
],

Usage

1. Add the Channel to Your Notification

In your notification class, add the via() method to specify the channel:

public function via($notifiable)
{
    return [AiqedgeSmtpChannel::class];
}

2. Define the toAiqedgeSmtp() Method

Add a toAiqedgeSmtp() method to your notification class. This should return an array with the email details:

public function toAiqedgeSmtp($notifiable)
{
    return [
        'to' => $notifiable->email,
        'subject' => 'Your Subject',
        'body' => 'Your message body',
        // Add other fields as required by AIQEDGE SMTP API
    ];
}

3. Send the Notification

Use Laravel's notification system as usual:

$user->notify(new YourNotification());

Request Body Reference

To see the possible request body and required fields, visit this Postman collection:

AIQEDGE SMTP Send Email Request Example (Postman)

Example

use Aiqedge\SmtpNotificationsChannel\AiqedgeSmtpChannel;
use Illuminate\Notifications\Notification;

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

    public function toAiqedgeSmtp($notifiable)
    {
        return [
            'to' => $notifiable->email,
            'subject' => 'Invoice Paid',
            'body' => 'Your invoice has been paid.',
        ];
    }
}

Error Handling

If the API request fails, the error will be logged using Laravel's logging system. Check your logs for details.

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-27