PHP code example of notifea / notifea-php-nette

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


class UserPresenter extends Nette\Application\UI\Presenter
{
    /** @var EmailService */
    protected $emailService;

    /** @var SmsService */
    protected $smsService;
    
    /** @var SmsSenderService */
    protected $smsSenderService;

    /**
     * UserPresenter constructor.
     * @param EmailService $emailService
     * @param SmsService $smsService
     * @param SmsSenderService $smsSenderService
     */
    public function __construct(
        EmailService $emailService,
        SmsService $smsService,
        SmsSenderService $smsSenderService
    ) {
        $this->emailService = $emailService;
        $this->smsService = $smsService;
        $this->smsSenderService = $smsSenderService;
    }

    public function actionSendEmail()
    {
        // .. your business logic
        $email = new Email();
        // ... 
        $sentEmail = $this->emailService->sendEmail($email);
    }

    public function actionSendSms()
    {
        // .. your business logic
        $sms = new Sms();
        // ... 
        $sentSms = $this->smsService->sendSms($sms);
    }
    
    public function actionCreateSmsSender()
    {
        // .. your business logic
        $smsSender = new SmsSender();
        // ... 
        $createdSmsSender = $this->smsSenderService->createSmsSender($smsSender);
    }

}
shell script
composer