PHP code example of vtinnovations / centralized-notification-suite

1. Go to this page and download the library: Download vtinnovations/centralized-notification-suite library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vtinnovations / centralized-notification-suite example snippets


use VTInnovations\CentralizedNotificationSuite\CentralizedNotificationSuite;

public function __construct(private readonly CentralizedNotificationSuite $notify) {}

$result = $this->notify->send('bestellbestaetigung', [
    'kunde_name'  => $order->name,
    'summe'       => $order->formattedTotal,
], 'de');

$result->isSuccessful();
$result->hasFailures();
$result->getErrors();
yaml
# config/config.yaml
centralized_notification_suite:
    log:
        enabled: true
        store_body: true        # nötig für erneuten Versand; ausschalten, um keine personenbezogenen Daten zu speichern
        retention_days: 90      # 0 behält Einträge dauerhaft
        max_attempts: 3
        retry_failed: true
    mailer:
        php_binary: ''          # leer bedeutet automatische Erkennung der PHP-CLI-Binärdatei
        process_timeout: 120    # Sekunden, bis der Cache-Neuaufbau abgebrochen wird
        memory_limit: '-1'      # nur für den Neuaufbau-Subprozess; '' übernimmt den Wert der CLI-php.ini