PHP code example of deslynx / alert-bundle

1. Go to this page and download the library: Download deslynx/alert-bundle 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/ */

    

deslynx / alert-bundle example snippets


// config/bundles.php

return [
    // ...
    DesLynx\AlertBundle\DesLynxAlertBundle::class => ['all' => true],
];

// src/Controller/SomeController.php

use DesLynx\AlertBundle\Service\AlertHelper;
//...

class SomeController
{
    public function index(AlertHelper $alertHelper) {
        $alertHelper->sendAlert(
            'A significant subject.',
            'A significant message. Either text or HTML.',
            false, // Optional. Set to true if the message is HTML
            ['[email protected]', '[email protected]' /*, ...*/] // Optional. A list of recipients to add in cc in addition to the globally defined recipients (see configuration)
         );
    }    
}