public function send(): Letter
    {
        $options = [
            'headers' => [
                'Content-Source' => $this->getEndpointMailbox().'/letters/'.$this->getLetterId(),
            ],
        ];

        if ($this->getEnvelope()->isHybridLetter() && null !== $this->getDeliveryOptions()) {
            $options['headers']['Content-Type'] = $this->getDeliveryOptions()->getMimeType();
            $options['json']                    = $this->getDeliveryOptions();
        }

        $this->getHttpClientForSend()->request('POST', '/deliveries', $options);

        return $this;
    }
public function send(): Letter
    {
        $options = [
            'headers' => [
                'Content-Source' => $this->getEndpointMailbox().'/letters/'.$this->getLetterId(),
            ],
        ];

        if ($this->getEnvelope()->isHybridLetter() && null !== $this->getDeliveryOptions()) {
            $options['headers']['Content-Type'] = $this->getDeliveryOptions()->getMimeType();
            $options['json']                    = $this->getDeliveryOptions();
        }

        $this->getHttpClientForSend()->request('POST', '/deliveries', $options);

        return $this;
    }
public function send ( ) : Letter { $ options = [ 'headers' => [ 'Content-Source' => $ this -> getEndpointMailbox ( ) . '/letters/' . $ this -> getLetterId ( ) , ] , ] ; if ( $ this -> getEnvelope ( ) -> isHybridLetter ( ) && null !== $ this -> getDeliveryOptions ( ) ) { $ options [ 'headers' ] [ 'Content-Type' ] = $ this -> getDeliveryOptions ( ) -> getMimeType ( ) ; $ options [ 'json' ] = $ this -> getDeliveryOptions ( ) ; } $ this -> getHttpClientForSend ( ) -> request ( 'POST' , '/deliveries' , $ options ) ; return $ this ; }
Send the given letter. Delivery options should be set optionally for physical letters

@return self
@throws BadResponseException See API Send Reference
Send the given letter . Delivery options should be set optionally for physical letters