PHP code example of clippings / swiftmailer-observers

1. Go to this page and download the library: Download clippings/swiftmailer-observers 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/ */

    

clippings / swiftmailer-observers example snippets


$mailer->registerPLugin(new ObserversPlugin([
    '[email protected]' => [
        'event1',
        'event2',
    ]
]));

$headers = $message->getHeaders();
$headers->addTextHeader(ObserversPlugin::HEADER, 'event1');

// Will add '[email protected]' to bcc
$mailer->send($message);