doSendApi example


    abstract protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $envelope): ResponseInterface;

    protected function doSendHttp(SentMessage $message): ResponseInterface
    {
        try {
            $email = MessageConverter::toEmail($message->getOriginalMessage());
        } catch (\Exception $e) {
            throw new RuntimeException(sprintf('Unable to send message with the "%s" transport: ', __CLASS__).$e->getMessage(), 0, $e);
        }

        return $this->doSendApi($message$email$message->getEnvelope());
    }

    /** * @return Address[] */
    protected function getRecipients(Email $email, Envelope $envelope): array
    {
        return array_filter($envelope->getRecipients()fn (Address $address) => false === \in_array($addressarray_merge($email->getCc()$email->getBcc()), true));
    }
}
Home | Imprint | This part of the site doesn't use cookies.