NSWDPC\Messaging\Mailgun\Tests\TestMessage
Extends the default message connector between Mailer and API, captures sending parameters and other data for testing purposes, doesn't actually send anything.
Synopsis
class TestMessage
extends Message
{
- // constants
- const MSG_ID = 'TESTONLY';
- const MSG_MESSAGE = 'This was handled as a test';
- // Inherited constants from Base
- const API_ENDPOINT_EU = 'https://api.eu.mailgun.net';
- // members
- protected string $sentVia = '';
- protected integer $sendIn = 0;
- protected array $finalParameters = ;
- protected static array $sendData = ;
- // Inherited members from Message
- protected integer $send_in_seconds;
- protected string $amp_html;
- protected array $template;
- protected array $options;
- protected array $headers;
- protected array $variables;
- protected array $recipient_variables;
- // methods
- protected void sendMessage()
- public void setSendData()
- public static void getSendData()
- // Inherited methods from Message
- public void getMime()
- public SendResponse|QueuedJobDescriptor|null send()
- protected void sendMessage()
- public void encodeAttachments()
- public void decodeAttachments()
- public void isDelivered()
- public static string cleanMessageId()
- public void setSendIn()
- public void getSendIn()
- public void setRecipientVariables()
- public void getRecipientVariables()
- public void setAmpHtml()
- public void getAmpHtml()
- public void setTemplate()
- public void getTemplate()
- public void setOptions()
- public void getOptions()
- public void setCustomHeaders()
- public void getCustomHeaders()
- public void setVariables()
- public void getVariables()
- protected void addCustomParameters()
- // Inherited methods from Base
- public static void DateTime()
- public void getClient()
- public void getApiEndpointRegion()
- public void getApiKey()
- public void getWebhookSigningKey()
- public void getWebhookFilterVariable()
- public void getWebhookPreviousFilterVariable()
- public void getWebhooksEnabled()
- public void getApiDomain()
- public void isSandbox()
- protected final void sendViaJob()
- protected final void alwaysSetSender()
- protected final void applyTestMode()
- public final void applyDefaultRecipient()
Hierarchy
Constants
Name | Value |
---|---|
MSG_ID | 'TESTONLY' |
MSG_MESSAGE | 'This was handled as a test' |
API_ENDPOINT_EU | 'https://api.eu.mailgun.net' |
Members
protected
- $amp_html
—
string
Accelerated Mobile Pages (AMP) HTML part - $finalParameters — array
- $headers
—
array
Headers (h:X-xxx), the X is NOT auto-prefixed - $options
—
array
Options (o:xxx) - $recipient_variables
—
array
Recipient variables for batch sending (recipient-variables) -
$sendData
Send data for the last message send() - $sendIn — int
- $send_in_seconds
—
float
Delay sending (via queued job) - $sentVia — string
- $template
—
array
Template options: name, verions, text (template, t:xxx) - $variables
—
array
Variables (v:xxx)
Methods
protected
- sendMessage() — Sends a message
public
- getSendData() — Get data that would be used
- setSendData() — Set data that would be used
Inherited from NSWDPC\Messaging\Mailgun\Connector\Message
protected
- addCustomParameters() — Based on options set in {@link NSWDPC\Messaging\Mailgun\MailgunEmail} set Mailgun options, params, headers and variables
- sendMessage() — Sends a message
public
- cleanMessageId() — Trim < and > from message id
- decodeAttachments() — Base64 decode attachments, for decoding attachments encoded with {@link self::encodeAttachments()}
- encodeAttachments() — Base64 encode attachments, primarily used to avoid attachment corruption issues when storing binary data in a queued job
- getAmpHtml()
- getCustomHeaders()
- getMime() — Retrieve MIME encoded version of message
- getOptions()
- getRecipientVariables()
- getSendIn()
- getTemplate()
- getVariables()
- isDelivered() — Lookup all events for the submission linked to this event
- send() — Send a message with parameters See: http://mailgun-documentation.readthedocs.io/en/latest/api-sending.html#sending
- setAmpHtml()
- setCustomHeaders() — Keys are not prefixed with "h:"
- setOptions() — Keys are not prefixed with "o:"
- setRecipientVariables()
- setSendIn() — When sending via a queued job, this the start time of the job in the future (in seconds) This is not the "o:deliverytime" option ("Messages can be scheduled for a maximum of 3 days in the future.") To set "deliverytime" set it as an option to setOptions()
- setTemplate()
- setVariables() — Keys are not prefixed with "v:"
Inherited from NSWDPC\Messaging\Mailgun\Connector\Base
protected
- alwaysSetSender() — When true, the Sender header is always set to the From value. When false, use {@link NSWDPC\Messaging\Mailgun\MailgunMailer::setSender()} to set the Sender header as required
- applyTestMode() — Prior to any send/sendMime action, check config and set testmode if config says so
- sendViaJob() — Whether to send via a queued job or
public
- DateTime() — Returns an RFC2822 datetime in the format accepted by Mailgun
- applyDefaultRecipient() — When Bcc/Cc is provided with no 'To', mailgun rejects the request (400 Bad Request), this method applies the configured default_recipient
- getApiDomain()
- getApiEndpointRegion()
- getApiKey()
- getClient()
- getWebhookFilterVariable()
- getWebhookPreviousFilterVariable()
- getWebhookSigningKey()
- getWebhooksEnabled()
- isSandbox()