diff --git a/src/Connector/Message.php b/src/Connector/Message.php index 7bf0b59..f837c96 100644 --- a/src/Connector/Message.php +++ b/src/Connector/Message.php @@ -137,20 +137,13 @@ protected function sendMessage(array $parameters) // send options $send_via_job = $this->sendViaJob(); $in = $this->getSendIn();// seconds - switch ($send_via_job) { - case 'yes': - return $this->queueAndSend($domain, $parameters, $in); - case 'when-attachments': - if (!empty($parameters['attachment'])) { - return $this->queueAndSend($domain, $parameters, $in); - } - // fallback to direct - // no break - case 'no': - default: - return $client->messages()->send($domain, $parameters); + if ($send_via_job == 'yes') { + return $this->queueAndSend($domain, $parameters, $in); + } elseif ($send_via_job == 'when-attachments' && !empty($parameters['attachment'])) { + return $this->queueAndSend($domain, $parameters, $in); + } else { + return $client->messages()->send($domain, $parameters); } - return null; } /**