PHP code example of atellitech / postal-yii2

1. Go to this page and download the library: Download atellitech/postal-yii2 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/ */

    

atellitech / postal-yii2 example snippets

=
...
"components": [
    "postal" => [
        'class' => 'AtelliTech\\Yii2\\Postal',
        'host' => $host,
        'key' => $key
    ]
]
=
$message = [
    'subject' => 'Hello Test',
    'to' => ['[email protected]',...],
    'from' => 'Test <[email protected]>',
    'html_body' => '<h3>Hello, Test</h3><p>How are you today?</p>'
];

$result = Yii::$app->postal->send($message);

=
...
"components": [
    "postal" => [
        'class' => 'AtelliTech\\Yii2\\Postal',
        'host' => $host,
        'key' => $key
    ],
    "log" => [
        'targets' => [
            [
                'class' => 'AtelliTech\Yii2\PostalLogTarget',
                'levels' => ['error', 'warning'],
                'postal' => 'postal',
                'subject' => '[Alert] System log', // anything your want
                'from' => 'SysAdmin <[email protected]>',  // anything your want
                'to' => ['[email protected]']  // any email addresses
            ],
        ]
    ]
]