public function sendFailed()
    {
        $messages = Message::findAll(['status' => Message::STATUS_ERROR]);
        foreach ($messages as $message) {
            try {
                $message->status = $this->send($message) > 0 ? Message::STATUS_SUCCESS : Message::STATUS_ERROR;
                $message->save(true, ['status']);
            } catch (\Exception $e) {
                $message->status = Message::STATUS_FATAL_ERROR;
                $message->save(true, ['status']);
                $this->stderr($e->getMessage());
            }
        }
    }
public function sendFailed()
    {
        $messages = Message::findAll(['status' => Message::STATUS_ERROR]);
        foreach ($messages as $message) {
            try {
                $message->status = $this->send($message) > 0 ? Message::STATUS_SUCCESS : Message::STATUS_ERROR;
                $message->save(true, ['status']);
            } catch (\Exception $e) {
                $message->status = Message::STATUS_FATAL_ERROR;
                $message->save(true, ['status']);
                $this->stderr($e->getMessage());
            }
        }
    }
public function sendFailed ( ) { $ messages = Message :: findAll ( [ 'status' => Message :: STATUS_ERROR ] ) ; foreach ( $ messages as $ message ) { try { $ message -> status = $ this -> send ( $ message ) > 0 ? Message :: STATUS_SUCCESS : Message :: STATUS_ERROR ; $ message -> save ( true , [ 'status' ] ) ; } catch ( \ Exception $ e ) { $ message -> status = Message :: STATUS_FATAL_ERROR ; $ message -> save ( true , [ 'status' ] ) ; $ this -> stderr ( $ e -> getMessage ( ) ) ; } } }
Send failed messages
Send failed messages