MailgunTransport
extends Transport
in package
Table of Contents
- $plugins : array<string|int, mixed>
- The plug-ins registered with the transport.
- $client : ClientInterface
- Guzzle client instance.
- $domain : string
- The Mailgun domain.
- $endpoint : string
- The Mailgun API end-point.
- $key : string
- The Mailgun API key.
- __construct() : void
- Create a new Mailgun transport instance.
- getDomain() : string
- Get the domain being used by the transport.
- getKey() : string
- Get the API key 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}
- setDomain() : string
- Set the domain being used by the transport.
- setKey() : string
- Set the API key being used by the transport.
- start() : mixed
- Start this Transport mechanism.
- stop() : mixed
- Stop this Transport mechanism.
- allContacts() : array<string|int, mixed>
- Get all of the contacts for the message.
- beforeSendPerformed() : void
- Iterate through registered plugins and execute plugins' methods.
- getTo() : string
- Get the "to" payload field for the API request.
- numberOfRecipients() : int
- Get the number of recipients.
- payload() : array<string|int, mixed>
- Get the HTTP payload for sending the Mailgun message.
- 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
$domain
The Mailgun domain.
protected
string
$domain
$endpoint
The Mailgun API end-point.
protected
string
$endpoint
$key
The Mailgun API key.
protected
string
$key
Methods
__construct()
Create a new Mailgun transport instance.
public
__construct(ClientInterface $client, string $key, string $domain[, string|null $endpoint = null ]) : void
Parameters
- $client : ClientInterface
- $key : string
- $domain : string
- $endpoint : string|null = null
Return values
void —getDomain()
Get the domain being used by the transport.
public
getDomain() : string
Return values
string —getKey()
Get the API key being used by the transport.
public
getKey() : string
Return values
string —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 —setDomain()
Set the domain being used by the transport.
public
setDomain(string $domain) : string
Parameters
- $domain : string
Return values
string —setKey()
Set the API key being used by the transport.
public
setKey(string $key) : string
Parameters
- $key : string
Return values
string —start()
Start this Transport mechanism.
public
start() : mixed
Return values
mixed —stop()
Stop this Transport mechanism.
public
stop() : mixed
Return values
mixed —allContacts()
Get all of the contacts for the message.
protected
allContacts(Swift_Mime_SimpleMessage $message) : array<string|int, mixed>
Parameters
- $message : Swift_Mime_SimpleMessage
Return values
array<string|int, 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 —getTo()
Get the "to" payload field for the API request.
protected
getTo(Swift_Mime_SimpleMessage $message) : string
Parameters
- $message : Swift_Mime_SimpleMessage
Return values
string —numberOfRecipients()
Get the number of recipients.
protected
numberOfRecipients(Swift_Mime_SimpleMessage $message) : int
Parameters
- $message : Swift_Mime_SimpleMessage
Return values
int —payload()
Get the HTTP payload for sending the Mailgun message.
protected
payload(Swift_Mime_SimpleMessage $message, string $to) : array<string|int, mixed>
Parameters
- $message : Swift_Mime_SimpleMessage
- $to : string
Return values
array<string|int, mixed> —sendPerformed()
Iterate through registered plugins and execute plugins' methods.
protected
sendPerformed(Swift_Mime_SimpleMessage $message) : void
Parameters
- $message : Swift_Mime_SimpleMessage