PHP code example of notifea / notifea-php

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

    

notifea / notifea-php example snippets


$client = new NotifeaClient(
    'https://api.notifea.com/v1',
    'Bearer {authorization}'
);

$client = new NotifeaClient(
    'https://api.notifea.com/v1',
    'Bearer {authorization}'
);

$emailService = new EmailService($client);

$email = new Email();
$email->setFrom('[email protected]', 'New Address')
    ->setRecipient('[email protected]')
    ->setReplyTo('[email protected]')
    ->setSubject('My first email')
    ->setHtmlBody('<p>This is my first email</p>')
    ->setCc('[email protected]')
;

$sentEmail = $emailService->sendEmail($email);

$emails = $emailService->getEmails();

$email = $emailService->getEmail('8fc2c850-81c0-4424-823a-aa4727441864');

$result = $emailService->deleteEmail('8fc2c850-81c0-4424-823a-aa4727441864');

$client = new NotifeaClient(
    'https://api.notifea.com/v1',
    'Bearer {authorization}'
);

$smsService = new SmsService($client);

$sms = new Sms();
$sms
    ->setRecipient('+421902739429')
    ->setSmsSenderid('59634971-e57f-44af-b530-038e27e7064e')
    ->setContent('My awesome SMS message.')
;

$sentSms = $smsService->sendSms($sms);

$smss = $smsService->getSmss();

$sms = $smsService->getSms('8fc2c850-81c0-4424-823a-aa4727441864');

$result = $smsService->deleteSms('8fc2c850-81c0-4424-823a-aa4727441864');

$client = new NotifeaClient(
    'https://api.notifea.com/v1',
    'Bearer {authorization}'
);

$smsSenderService = new SmsSenderService($client);

$smsSender = new SmsSender();
$smsSender
    ->setSenderName('My Sender')
;

$createdSmsSender = $smsSenderService->createSmsSender($smsSender);

$smsSenders = $smsSenderService->getSmsSenders();

$smsSender = $smsSenderService->getSmsSender('8fc2c850-81c0-4424-823a-aa4727441864');

$smsSender = new SmsSender();
$smsSender
    ->setUuid('8fc2c850-81c0-4424-823a-aa4727441864') // sSender($smsSender);

$result = $smsSenderService->deleteSmsSender('8fc2c850-81c0-4424-823a-aa4727441864');
shell script
composer