class SparkPostTransport extends Transport

Properties

array $plugins

The plug-ins registered with the transport.

from  Transport
protected ClientInterface $client

Guzzle client instance.

protected string $key

The SparkPost API key.

protected array $options

Transmission options.

Methods

isStarted()

{@inheritdoc}

start()

{@inheritdoc}

stop()

{@inheritdoc}

void
registerPlugin(Swift_Events_EventListener $plugin)

Register a plug-in with the transport.

void
beforeSendPerformed(Swift_Mime_Message $message)

Iterate through registered plugins and execute plugins' methods.

void
sendPerformed(Swift_Mime_Message $message)

Iterate through registered plugins and execute plugins' methods.

int
numberOfRecipients(Swift_Mime_Message $message)

Get the number of recipients.

void
__construct(ClientInterface $client, string $key, array $options = [])

Create a new SparkPost transport instance.

send(Swift_Mime_Message $message, $failedRecipients = null)

{@inheritdoc}

array
getRecipients(Swift_Mime_Message $message)

Get all the addresses this message should be sent to.

string
getTransmissionId(Response $response)

Get the transmission ID from the response.

string
getKey()

Get the API key being used by the transport.

string
setKey(string $key)

Set the API key being used by the transport.

string
getOptions()

Get the transmission options being used by the transport.

array
setOptions(array $options)

Set the transmission options being used by the transport.

Details

in Transport at line 22
isStarted()

{@inheritdoc}

in Transport at line 30
start()

{@inheritdoc}

in Transport at line 38
stop()

{@inheritdoc}

in Transport at line 49
void registerPlugin(Swift_Events_EventListener $plugin)

Register a plug-in with the transport.

Parameters

Swift_Events_EventListener $plugin

Return Value

void

in Transport at line 60
protected void beforeSendPerformed(Swift_Mime_Message $message)

Iterate through registered plugins and execute plugins' methods.

Parameters

Swift_Mime_Message $message

Return Value

void

in Transport at line 77
protected void sendPerformed(Swift_Mime_Message $message)

Iterate through registered plugins and execute plugins' methods.

Parameters

Swift_Mime_Message $message

Return Value

void

in Transport at line 94
protected int numberOfRecipients(Swift_Mime_Message $message)

Get the number of recipients.

Parameters

Swift_Mime_Message $message

Return Value

int

at line 39
void __construct(ClientInterface $client, string $key, array $options = [])

Create a new SparkPost transport instance.

Parameters

ClientInterface $client
string $key
array $options

Return Value

void

at line 49
send(Swift_Mime_Message $message, $failedRecipients = null)

{@inheritdoc}

Parameters

Swift_Mime_Message $message
$failedRecipients

at line 86
protected array getRecipients(Swift_Mime_Message $message)

Get all the addresses this message should be sent to.

Note that SparkPost still respects CC, BCC headers in raw message itself.

Parameters

Swift_Mime_Message $message

Return Value

array

at line 111
protected string getTransmissionId(Response $response)

Get the transmission ID from the response.

Parameters

Response $response

Return Value

string

at line 123
string getKey()

Get the API key being used by the transport.

Return Value

string

at line 134
string setKey(string $key)

Set the API key being used by the transport.

Parameters

string $key

Return Value

string

at line 144
string getOptions()

Get the transmission options being used by the transport.

Return Value

string

at line 155
array setOptions(array $options)

Set the transmission options being used by the transport.

Parameters

array $options

Return Value

array