PHP code example of symfony / rocket-chat-notifier

1. Go to this page and download the library: Download symfony/rocket-chat-notifier 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/ */

    

symfony / rocket-chat-notifier example snippets


$payload = [
   'alias' => 'Bot Name',
   'emoji' => ':joy:', // Emoji used as avatar
   'avatar' => 'http://site.com/logo.png', // Overridden by emoji if provided
   'channel' => '#myChannel', // Overrides the DSN's channel setting
];

$attachement1 = [
    'color' => '#ff0000',
    'title' => 'My title',
    'text' => 'My text',
    // ...
];

$attachement2 = [
    'color' => '#ff0000',
    'title' => 'My title',
    'text' => 'My text',
    // ...
];

// For backward compatibility reasons, both usages are valid
$rocketChatOptions = new RocketChatOptions($attachement1, $payload);
$rocketChatOptions = new RocketChatOptions([$attachement1, $attachement2], $payload);