Naux\Mail\SendCloudTransport::sendTemplate PHP Method

sendTemplate() protected method

发送模板邮件.
protected sendTemplate ( Swift_Mime_Message $message ) : boolean
$message Swift_Mime_Message
return boolean
    protected function sendTemplate(Swift_Mime_Message $message)
    {
        $http = new Client();
        $template = $message->getBody();
        $this->addQuery('template_invoke_name', $template->getName());
        $this->addQuery('substitution_vars', json_encode(['to' => [$this->getAddress($message->getTo())], 'sub' => $template->getBindData()]));
        $response = $http->post(self::SEND_TEMPLATE_URL, ['multipart' => $this->query]);
        return $this->response($response);
    }