symfony/prelude-notifier

Symfony Prelude Notifier Bridge

Maintainers

Package info

github.com/symfony/prelude-notifier

Type:symfony-notifier-bridge

pkg:composer/symfony/prelude-notifier

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

v8.1.0-BETA1 2026-04-30 08:33 UTC

This package is auto-updated.

Last update: 2026-05-18 17:34:32 UTC


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'.