PHP code example of cronox / cake-cron-jobs

1. Go to this page and download the library: Download cronox/cake-cron-jobs 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/ */

    

cronox / cake-cron-jobs example snippets


Plugin::load('Cronox/CronJobs');

try {
    CronJobHelper::create(\App\Lib\Mailer::class, 'sendMail', ['[email protected]','Message text']);
} catch (\Exception $exception) {
    throw $exception;
}

try {
    $groupEmailCode = 'Email';
    $groupSMSCode = 'SMS';
    CronJobHelper::create(\App\Lib\Mailer::class, 'sendMail', ['[email protected]','Message text'], $groupEmailCode);
    CronJobHelper::create(\App\Lib\SmsApi::class, 'sendSMS', ['321654987','Message text'], $groupSMSCode);
} catch (\Exception $exception) {
    throw $exception;
}