class MailgunTransport extends Transport (View source)

Properties

array $plugins

The plug-ins registered with the transport.

from  Transport
protected ClientInterface $client

Guzzle client instance.

protected string $key

The Mailgun API key.

protected string $domain

The Mailgun email domain.

protected string $endpoint

The Mailgun API endpoint.

Methods

bool
isStarted()

{@inheritdoc}

start()

{@inheritdoc}

stop()

{@inheritdoc}

bool
ping()

{@inheritdoc}

void
registerPlugin(Swift_Events_EventListener $plugin)

Register a plug-in with the transport.

void
beforeSendPerformed(Swift_Mime_SimpleMessage $message)

Iterate through registered plugins and execute plugins' methods.

void
sendPerformed(Swift_Mime_SimpleMessage $message)

Iterate through registered plugins and execute plugins' methods.

int
numberOfRecipients(Swift_Mime_SimpleMessage $message)

Get the number of recipients.

void
__construct(ClientInterface $client, string $key, string $domain, string|null $endpoint = null)

Create a new Mailgun transport instance.

int
send(Swift_Mime_SimpleMessage $message, $failedRecipients = null)

{@inheritdoc}

array
payload(Swift_Mime_SimpleMessage $message, string $to)

Get the HTTP payload for sending the Mailgun message.

string
getTo(Swift_Mime_SimpleMessage $message)

Get the "to" payload field for the API request.

array
allContacts(Swift_Mime_SimpleMessage $message)

Get all of the contacts for the message.

string
getMessageId(ResponseInterface $response)

Get the message 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
getDomain()

Get the domain being used by the transport.

string
setDomain(string $domain)

Set the domain being used by the transport.

string
getEndpoint()

Get the API endpoint being used by the transport.

string
setEndpoint(string $endpoint)

Set the API endpoint being used by the transport.

Details

bool isStarted()

{@inheritdoc}

Return Value

bool

start()

{@inheritdoc}

stop()

{@inheritdoc}

bool ping()

{@inheritdoc}

Return Value

bool

void registerPlugin(Swift_Events_EventListener $plugin)

Register a plug-in with the transport.

Parameters

Swift_Events_EventListener $plugin

Return Value

void

protected void beforeSendPerformed(Swift_Mime_SimpleMessage $message)

Iterate through registered plugins and execute plugins' methods.

Parameters

Swift_Mime_SimpleMessage $message

Return Value

void

protected void sendPerformed(Swift_Mime_SimpleMessage $message)

Iterate through registered plugins and execute plugins' methods.

Parameters

Swift_Mime_SimpleMessage $message

Return Value

void

protected int numberOfRecipients(Swift_Mime_SimpleMessage $message)

Get the number of recipients.

Parameters

Swift_Mime_SimpleMessage $message

Return Value

int

void __construct(ClientInterface $client, string $key, string $domain, string|null $endpoint = null)

Create a new Mailgun transport instance.

Parameters

ClientInterface $client
string $key
string $domain
string|null $endpoint

Return Value

void

int send(Swift_Mime_SimpleMessage $message, $failedRecipients = null)

{@inheritdoc}

Parameters

Swift_Mime_SimpleMessage $message
$failedRecipients

Return Value

int

protected array payload(Swift_Mime_SimpleMessage $message, string $to)

Get the HTTP payload for sending the Mailgun message.

Parameters

Swift_Mime_SimpleMessage $message
string $to

Return Value

array

protected string getTo(Swift_Mime_SimpleMessage $message)

Get the "to" payload field for the API request.

Parameters

Swift_Mime_SimpleMessage $message

Return Value

string

protected array allContacts(Swift_Mime_SimpleMessage $message)

Get all of the contacts for the message.

Parameters

Swift_Mime_SimpleMessage $message

Return Value

array

protected string getMessageId(ResponseInterface $response)

Get the message ID from the response.

Parameters

ResponseInterface $response

Return Value

string

string getKey()

Get the API key being used by the transport.

Return Value

string

string setKey(string $key)

Set the API key being used by the transport.

Parameters

string $key

Return Value

string

string getDomain()

Get the domain being used by the transport.

Return Value

string

string setDomain(string $domain)

Set the domain being used by the transport.

Parameters

string $domain

Return Value

string

string getEndpoint()

Get the API endpoint being used by the transport.

Return Value

string

string setEndpoint(string $endpoint)

Set the API endpoint being used by the transport.

Parameters

string $endpoint

Return Value

string