//-------------------------------------------------------------------- // Send New User Registration Email Events::on('didRegisterUser', function ($data) { if ($data['method'] != 'email') { return true; } return Mail::deliver('UserMailer:didRegister', [$data]); }, EVENTS_PRIORITY_NORMAL); //-------------------------------------------------------------------- // Send Forgotten Password email Events::on('didRemindUser', function ($user, $token) { return Mail::deliver('UserMailer:remindUser', [$user, $token]); }, EVENTS_PRIORITY_NORMAL); //-------------------------------------------------------------------- // Send Reset Password notice Events::on('didResetPassword', function ($user) { return Mail::deliver('UserMailer:resetPassword', [$user]); }, EVENTS_PRIORITY_NORMAL); //-------------------------------------------------------------------- // Cron Job Events //-------------------------------------------------------------------- // Send Cron Job Summary Email // Uncomment the following block to enable mailing of cron // task results to the email in application config as site.auth_email. /* Events::on('afterCron', function($output) { return Mail::queue('CronMailer:results', [$output]); }, EVENTS_PRIORITY_NORMAL); */
public function testDeliverReturnsTrueOnSuccess() { $cmd = "CronMailer:results"; $this->assertTrue(Mail::deliver($cmd)); }