定制 symfony/prelude-notifier 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

symfony/prelude-notifier

最新稳定版本:v8.1.0-BETA1

Composer 安装命令:

composer require symfony/prelude-notifier

包简介

Symfony Prelude Notifier Bridge

README 文档

README

The prelude-notifier package provides a Prelude bridge for Symfony Notifier.

Installation

composer require symfony/prelude-notifier

Configuration

  1. Register the bundle in your application (if not using Symfony Flex).

  2. Configure the DSN in your .env file:

    # API Key is required
    # Sender ID is optional (can be set in options or DSN)
    PRELUDE_DSN=prelude://YOUR_API_KEY@default?sender=YOUR_SENDER_ID

Usage

The Prelude Notify API requires a template_id. You must use PreludeOptions to provide it.

use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Prelude\PreludeOptions;

$options = new PreludeOptions(
    templateId: 'template_01k8xxxxxxxxxxxxx', // Required
    variables: [
        'order_id' => '12345',
        'amount' => '$49.99',
    ],
    // Optional parameters
    // from: 'MySenderID',
    // locale: 'fr-FR',
    // callbackUrl: 'https://example.com/webhook',
    // preferredChannel: 'whatsapp'
);

$message = (new SmsMessage('+33612345678', 'Subject (ignored)'))
    ->options($options);

$notifier->send($message);

Options

  • templateId (string, required): The template identifier.
  • variables (array): Key-value pairs for template variables.
  • from (string): The Sender ID.
  • locale (string): BCP-47 formatted locale string.
  • expiresAt (string): Message expiration date (RFC3339).
  • scheduleAt (string): Schedule delivery time (RFC3339).
  • callbackUrl (string): URL for delivery events.
  • correlationId (string): User-defined identifier.
  • preferredChannel (string): 'sms' or 'whatsapp'.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固