src/Viserio/Component/Mail/Transport/SparkPostTransport.php
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null): int
    {
        $this->beforeSendPerformed($message);

        $recipients = $this->getRecipients($message);

        $message->setBcc([]);

        $options = [
            'headers' => [
                'Authorization' => $this->key,
            ],
            'json' => [
                'recipients' => $recipients,
                'content'    => [
                    'email_rfc822' => $message->toString(),
                ],
            ],
        ];

        if (\count($this->options) !== 0) {
            $options['json']['options'] = $this->options;
        }

        $response = $this->client->post($this->endpoint, $options);

        $message->getHeaders()->addTextHeader('X-SparkPost-Transmission-ID', $this->getTransmissionId($response));

        $this->sendPerformed($message);

        return $this->numberOfRecipients($message);
    }
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null): int
    {
        $this->beforeSendPerformed($message);

        $recipients = $this->getRecipients($message);

        $message->setBcc([]);

        $options = [
            'headers' => [
                'Authorization' => $this->key,
            ],
            'json' => [
                'recipients' => $recipients,
                'content'    => [
                    'email_rfc822' => $message->toString(),
                ],
            ],
        ];

        if (\count($this->options) !== 0) {
            $options['json']['options'] = $this->options;
        }

        $response = $this->client->post($this->endpoint, $options);

        $message->getHeaders()->addTextHeader('X-SparkPost-Transmission-ID', $this->getTransmissionId($response));

        $this->sendPerformed($message);

        return $this->numberOfRecipients($message);
    }
{@inheritdoc}