src/Client.php
/**
     * Sends a message to the customer
     *
     * @param int $orderId The internal id of the order
     * @param Model\MessageForCustomer $message The message model
     * @return bool True if the message was send, otherwise false
     *
     * @throws QuotaExceededException If the maximum number of calls per second exceeded
     * @throws Exception If the response cannot be parsed
     * @throws InvalidArgumentException If the request is not valid
     */
Sends a message to the customer
@param int $orderId The internal id of the order
@param Model\MessageForCustomer $message The message model
@return bool True if the message was send, otherwise false

@throws QuotaExceededException If the maximum number of calls per second exceeded
@throws Exception If the response cannot be parsed
@throws InvalidArgumentException If the request is not valid
Sends a message to the customer @param int $orderId The internal id of the order @param Model \ MessageForCustomer $message The message model @return bool True if the message was send otherwise false @throws QuotaExceededException If the maximum number of calls per second exceeded @throws Exception If the response cannot be parsed @throws InvalidArgumentException If the request is not valid
public function sendMessage($orderId, Model\MessageForCustomer $message)
    {
        if ($message->sendMode < 0 || $message->sendMode > 4) {
            $msg = sprintf("The sendMode is invalid. Check the %s class for valid values", Type\SendMode::class);
            throw new InvalidArgumentException($msg);
        } elseif (!is_array($message->subject) || count($message->subject) == 0) {
            throw new InvalidArgumentException("You have to specify a message subject");
        } elseif (!is_array($message->body) || count($message->body) == 0) {
            throw new InvalidArgumentException("You have to specify a message body");
        } elseif ($message->sendMode == Type\SendMode::EXTERNAL_EMAIL && empty($message->alternativeEmailAddress)) {
            $msg = "With sendMode == 4 it's required to specify an alternativeEmailAddress";
            throw new InvalidArgumentException($msg);
        }
        if ($message->sendMode != Type\SendMode::EXTERNAL_EMAIL && !empty($message->alternativeEmailAddress)) {
            $this->logger->warning('The alternative email address is ignored because sendMode != 4');
        }
        $res = $this->requestPOST(
            'orders/' . $orderId . '/send-message',
            $this->jom->serialize($message),
            Response\BaseResponse::class
        );
        return $res === '' || $res === null;
    }
public function sendMessage ( $ orderId , Model \ MessageForCustomer $ message ) { if ( $ message -> sendMode < 0 || $ message -> sendMode > 4 ) { $ msg = sprintf ( " The sendMode is invalid. Check the %s class for valid values " , Type \ SendMode :: class ) ; throw new InvalidArgumentException ( $ msg ) ; } elseif ( ! is_array ( $ message -> subject ) || count ( $ message -> subject ) == 0 ) { throw new InvalidArgumentException ( " You have to specify a message subject " ) ; } elseif ( ! is_array ( $ message -> body ) || count ( $ message -> body ) == 0 ) { throw new InvalidArgumentException ( " You have to specify a message body " ) ; } elseif ( $ message -> sendMode == Type \ SendMode :: EXTERNAL_EMAIL && empty ( $ message -> alternativeEmailAddress ) ) { $ msg = " With sendMode == 4 it's required to specify an alternativeEmailAddress " ; throw new InvalidArgumentException ( $ msg ) ; } if ( $ message -> sendMode != Type \ SendMode :: EXTERNAL_EMAIL && ! empty ( $ message -> alternativeEmailAddress ) ) { $ this -> logger -> warning ( 'The alternative email address is ignored because sendMode != 4' ) ; } $ res = $ this -> requestPOST ( 'orders/' . $ orderId . '/send-message' , $ this -> jom -> serialize ( $ message ) , Response \ BaseResponse :: class ) ; return $ res === '' || $ res === null ; }
Sends a message to the customer
 @param int $orderId The internal id of the order
 @param Model\MessageForCustomer $message The message model
 @return bool True if the message was send, otherwise false
Sends a message to the customer @param int $orderId The internal id of the order @param Model \ MessageForCustomer $message The message model @return bool True if the message was send otherwise false