SparkPostTransport
extends Transport
in package
Table of Contents
- $plugins : array<string|int, mixed>
- The plug-ins registered with the transport.
- $client : ClientInterface
- Guzzle client instance.
- $key : string
- The SparkPost API key.
- $options : array<string|int, mixed>
- Transmission options.
- __construct() : void
- Create a new SparkPost transport instance.
- getKey() : string
- Get the API key being used by the transport.
- getOptions() : array<string|int, mixed>
- Get the transmission options being used by the transport.
- isStarted() : bool
- Test if this Transport mechanism has started.
- ping() : bool
- Check if this Transport mechanism is alive.
- registerPlugin() : void
- Register a plug-in with the transport.
- send() : mixed
- {@inheritdoc}
- setKey() : string
- Set the API key being used by the transport.
- setOptions() : array<string|int, mixed>
- Set the transmission options being used by the transport.
- start() : mixed
- Start this Transport mechanism.
- stop() : mixed
- Stop this Transport mechanism.
- beforeSendPerformed() : void
- Iterate through registered plugins and execute plugins' methods.
- getRecipients() : array<string|int, mixed>
- Get all the addresses this message should be sent to.
- getTransmissionId() : string
- Get the transmission ID from the response.
- numberOfRecipients() : int
- Get the number of recipients.
- sendPerformed() : void
- Iterate through registered plugins and execute plugins' methods.
Properties
$plugins
The plug-ins registered with the transport.
public
array<string|int, mixed>
$plugins
= []
$client
Guzzle client instance.
protected
ClientInterface
$client
$key
The SparkPost API key.
protected
string
$key
$options
Transmission options.
protected
array<string|int, mixed>
$options
= []
Methods
__construct()
Create a new SparkPost transport instance.
public
__construct(ClientInterface $client, string $key[, array<string|int, mixed> $options = [] ]) : void
Parameters
- $client : ClientInterface
- $key : string
- $options : array<string|int, mixed> = []
Return values
void —getKey()
Get the API key being used by the transport.
public
getKey() : string
Return values
string —getOptions()
Get the transmission options being used by the transport.
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —isStarted()
Test if this Transport mechanism has started.
public
isStarted() : bool
Return values
bool —ping()
Check if this Transport mechanism is alive.
public
ping() : bool
Return values
bool —TRUE if the transport is alive
registerPlugin()
Register a plug-in with the transport.
public
registerPlugin(Swift_Events_EventListener $plugin) : void
Parameters
- $plugin : Swift_Events_EventListener
Return values
void —send()
{@inheritdoc}
public
send(Swift_Mime_SimpleMessage $message[, mixed &$failedRecipients = null ]) : mixed
Parameters
- $message : Swift_Mime_SimpleMessage
- $failedRecipients : mixed = null
Return values
mixed —setKey()
Set the API key being used by the transport.
public
setKey(string $key) : string
Parameters
- $key : string
Return values
string —setOptions()
Set the transmission options being used by the transport.
public
setOptions(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed>
Return values
array<string|int, mixed> —start()
Start this Transport mechanism.
public
start() : mixed
Return values
mixed —stop()
Stop this Transport mechanism.
public
stop() : mixed
Return values
mixed —beforeSendPerformed()
Iterate through registered plugins and execute plugins' methods.
protected
beforeSendPerformed(Swift_Mime_SimpleMessage $message) : void
Parameters
- $message : Swift_Mime_SimpleMessage
Return values
void —getRecipients()
Get all the addresses this message should be sent to.
protected
getRecipients(Swift_Mime_SimpleMessage $message) : array<string|int, mixed>
Note that SparkPost still respects CC, BCC headers in raw message itself.
Parameters
- $message : Swift_Mime_SimpleMessage
Return values
array<string|int, mixed> —getTransmissionId()
Get the transmission ID from the response.
protected
getTransmissionId(Response $response) : string
Parameters
- $response : Response
Return values
string —numberOfRecipients()
Get the number of recipients.
protected
numberOfRecipients(Swift_Mime_SimpleMessage $message) : int
Parameters
- $message : Swift_Mime_SimpleMessage
Return values
int —sendPerformed()
Iterate through registered plugins and execute plugins' methods.
protected
sendPerformed(Swift_Mime_SimpleMessage $message) : void
Parameters
- $message : Swift_Mime_SimpleMessage