src/Client.php
private function arrayToMessage($m)
    {
        $message = new Message();
        $message->setId($m['id']);
        $message->setUuid($m['uuid']);
        $message->setUser($m['user']);
        $message->setStamp($m['stamp']);
        $message->setStatus($m['status']);
        $message->setFromAddress($m['fromAddress']);
        $message->setFromName($m['fromName']);

        $addresses = $this->parseAddresses($m['to']);
        $message->setTo($addresses);

        $addresses = $this->parseAddresses($m['cc']);
        $message->setCc($addresses);

        $addresses = $this->parseAddresses($m['bcc']);
        $message->setBcc($addresses);

        $message->setSubject($m['subject']);

        if (isset($m['template'])) {
            $t = $m['template'];
            $template = new Template();
            $template->setId($t['id']);
            //$template->setUuid($m['template']['uuid']);
            $template->setCode($t['code']);
            $template->setUser($t['user']);
            $template->setStatus($t['status']);
            $template->setFromAddress($t['fromEmail']);
            $template->setFromName($t['fromName']);

            $addresses = $this->parseAddresses($t['cc']);
            $template->setCc($addresses);

            $addresses = $this->parseAddresses($t['bcc']);
            $template->setBcc($addresses);

            $template->setBody($t['body']);
            $template->setBodyMarkup($t['bodyMarkup']);

            if (isset($t['layout'])) {
                $l = $t['layout'];
                $layout = new Layout();
                $layout->setId($l['id']);
                $layout->setCode($l['code']);
                $layout->setBody($l['body']);
                $template->setLayout($layout);
            }
            $message->setTemplate($template);
        }

        return $message;
    }
private function arrayToMessage($m)
    {
        $message = new Message();
        $message->setId($m['id']);
        $message->setUuid($m['uuid']);
        $message->setUser($m['user']);
        $message->setStamp($m['stamp']);
        $message->setStatus($m['status']);
        $message->setFromAddress($m['fromAddress']);
        $message->setFromName($m['fromName']);

        $addresses = $this->parseAddresses($m['to']);
        $message->setTo($addresses);

        $addresses = $this->parseAddresses($m['cc']);
        $message->setCc($addresses);

        $addresses = $this->parseAddresses($m['bcc']);
        $message->setBcc($addresses);

        $message->setSubject($m['subject']);

        if (isset($m['template'])) {
            $t = $m['template'];
            $template = new Template();
            $template->setId($t['id']);
            //$template->setUuid($m['template']['uuid']);
            $template->setCode($t['code']);
            $template->setUser($t['user']);
            $template->setStatus($t['status']);
            $template->setFromAddress($t['fromEmail']);
            $template->setFromName($t['fromName']);

            $addresses = $this->parseAddresses($t['cc']);
            $template->setCc($addresses);

            $addresses = $this->parseAddresses($t['bcc']);
            $template->setBcc($addresses);

            $template->setBody($t['body']);
            $template->setBodyMarkup($t['bodyMarkup']);

            if (isset($t['layout'])) {
                $l = $t['layout'];
                $layout = new Layout();
                $layout->setId($l['id']);
                $layout->setCode($l['code']);
                $layout->setBody($l['body']);
                $template->setLayout($layout);
            }
            $message->setTemplate($template);
        }

        return $message;
    }
------------ Message convert to Object-------------------