PHP code example of mipotech / yii2-pulseem

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

    

mipotech / yii2-pulseem example snippets


return [
    ...
    
    'pulseem' => [
        // Basic config
        'password' => '...',
        'username' => '...',
        //'endpoint' => '...', // Optionally configure a custom endpoint instead of the default
        
        // For email operations (optional)
        'fromEmail' => '...',
        'fromName' => '...'
        
        // For SMS operations (optional)
        'senderPhone' => '...',
    ],
    ...
];

use mipotech\pulseem\PulseemSdk;

$pulseem = new PulseemSdk();

$params = [
    'htmlBody' => '<p>Body here</p>',
    'subject' => 'Testing',
    'toEmail' => '[email protected]',
];
$res = $pulseem->sendSingleEmail($params);

$params = [
    'subject' => 'Testing',
    'toEmail' => '[email protected]',
];
$bodyTemplate = '@app/views/emails/customTeplate';
$bodyParams = [
    'model' => $model,
    'index' => $i,
]
$res = $pulseem->sendSingleEmail($params, $bodyTemplate, $bodyParams);

$params = [
    'htmlBodies' => [
        '<p>Body here 1</p>',
        '<p>Body here 2</p>',
    ],
    'subjects' => [
        'Testing 1',
        'Testing 2',
    ],
    'toEmails' => [
        '[email protected]',
        '[email protected]',
    ],
    'toNames' => [
        'Test User 1',
        'Test User 2',
    ],
];
$res = $pulseem->sendGroupEmail($params);

$params = [
    'htmlBody' => '<p>Body here</p>',
    'subject' => 'Testing',
    'toEmails' => [
        '[email protected]',
        '[email protected]',
    ],
    'toNames' => ['Test 1', 'Test 2'],
];
$res = $pulseem->sendGroupSameEmail($params);

$res = $pulseem->sendSingleSms('+972541112222', 'Testing', [
    'delayDeliveryMinutes' => 1,    // optional
    'externalRef' => '111222',      // optional
]);