Last active
September 5, 2020 09:54
-
-
Save WinterSilence/9782250 to your computer and use it in GitHub Desktop.
Example Kohana CLI Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('SYSPATH') OR die('No direct script access.'); | |
/** | |
* Example... | |
* | |
* @package Kohana/CLI | |
* @category Task | |
* @author Kohana Team | |
* @copyright (c) 2013-2014 Kohana Team | |
* @license http://kohanaframework.org/license | |
*/ | |
class CLI_Task_Mailer extends CLI_Task { | |
/** | |
* Send mails. | |
* | |
* @return void | |
*/ | |
protected function action() | |
{ | |
$mail = Mail::factory('...')->subject('...')->body('...')->from('..'); | |
$users = ORM::factory('User')->find_all(); | |
foreach ($users as $user) | |
{ | |
$mail->to($user->email)->send(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment