PHP Class Postmark\PostmarkAdminClient

Inheritance: extends PostmarkClientBase
Mostra file Open project: wildbit/postmark-php Class Usage Examples

Public Methods

Method Description
__construct ( string $accountToken, integer $timeout = 30 ) Create a new PostmarkAdminClient.
createDomain ( string $name, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel Create a new Domain with the given Name.
createSenderSignature ( string $fromEmail, string $name, string $replyToEmail = NULL, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel Create a new Sender Signature for a given email address. Note that you will need to "verify" this Sender Signature by following a link that will be emailed to the "fromEmail" address specified when calling this method.
createServer ( string $name, string $color = NULL, boolean $rawEmailEnabled = NULL, boolean $smtpApiActivated = NULL, string $inboundHookUrl = NULL, string $bounceHookUrl = NULL, string $openHookUrl = NULL, boolean $postFirstOpenOnly = NULL, boolean $trackOpens = NULL, string $inboundDomain = NULL, integer $inboundSpamThreshold = NULL, string $trackLinks = NULL ) : Postmark\Models\DynamicResponseModel Create a new Server. Any parameters passed with NULL will be ignored (their default values will be used).
deleteDomain ( integer $id ) : Postmark\Models\DynamicResponseModel Delete a Domain with the given ID.
deleteSenderSignature ( integer $id ) : Postmark\Models\DynamicResponseModel Delete a Sender Signature with the given ID.
deleteServer ( integer $id ) Delete a Server used for sending/receiving mail. NOTE: To protect your account, you'll need to contact support and request that they enable this feature on your account before you can use this client to delete Servers.
editDomain ( integer $id, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel Alter the properties of a Domain.
editSenderSignature ( integer $id, string $name = NULL, string $replyToEmail = NULL, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel Alter the defaults for a Sender Signature.
editServer ( integer $id, string $name = NULL, string $color = NULL, boolean $rawEmailEnabled = NULL, boolean $smtpApiActivated = NULL, string $inboundHookUrl = NULL, string $bounceHookUrl = NULL, string $openHookUrl = NULL, boolean $postFirstOpenOnly = NULL, boolean $trackOpens = NULL, string $inboundDomain = NULL, integer $inboundSpamThreshold = NULL, string $trackLinks = NULL ) : Postmark\Models\DynamicResponseModel Modify an existing Server. Any parameters passed with NULL will be ignored (their existing values will not be modified).
getDomain ( integer $id ) : Postmark\Models\DynamicResponseModel Get information for a specific Domain.
getSenderSignature ( integer $id ) : Postmark\Models\DynamicResponseModel Get information for a specific Sender Signature.
getServer ( integer $id ) : Postmark\Models\DynamicResponseModel Request a given server by ID.
listDomains ( integer $count = 100, $offset ) : Postmark\Models\DynamicResponseModel Get a "page" of Domains.
listSenderSignatures ( integer $count = 100, $offset ) : Postmark\Models\DynamicResponseModel Get a "page" of Sender Signatures.
listServers ( integer $count = 100, integer $offset, string $name = NULL ) : Postmark\Models\DynamicResponseModel Get a list of all servers configured on the account.
requestNewSenderSignatureDKIM ( integer $id ) : Postmark\Models\DynamicResponseModel Cause a new DKIM key to be generated and associated with the Sender Signature. This key must be added to your email domain's DNS records. Including DKIM is not required, but is recommended. For more information on DKIM and its purpose, see http://www.dkim.org/
resendSenderSignatureConfirmation ( integer $id ) : Postmark\Models\DynamicResponseModel Cause a new verification email to be sent for an existing (unverified) Sender Signature.
rotateDKIMForDomain ( integer $id ) : Postmark\Models\DynamicResponseModel Rotate DKIM keys associated with the Domain. This key must be added to your DNS records. Including DKIM is not required, but is recommended. For more information on DKIM and its purpose, see http://www.dkim.org/
verifyDomainSPF ( integer $id ) : Postmark\Models\DynamicResponseModel Request that the Postmark API verify the SPF records associated with the Domain. Configuring SPF is not required to use Postmark, but it is highly recommended, and can improve delivery rates.
verifySenderSignatureSPF ( integer $id ) : Postmark\Models\DynamicResponseModel Request that the Postmark API updates verify the SPF records associated with the Sender Signature's email address's domain. Configuring SPF is not required to use Postmark, but it is highly recommended, and can improve delivery rates.

Method Details

__construct() public method

Create a new PostmarkAdminClient.
public __construct ( string $accountToken, integer $timeout = 30 )
$accountToken string The Account Token used to access the Admin API. This token is NOT the same as a Server Token. You can get your account token from this page: https://postmarkapp.com/account/edit
$timeout integer The timeout, in seconds, that API calls should wait before throwing an exception.

createDomain() public method

Create a new Domain with the given Name.
public createDomain ( string $name, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel
$name string The name of the Domain.
$returnPathDomain string The custom Return-Path domain for the Sender Signature.
return Postmark\Models\DynamicResponseModel

createSenderSignature() public method

Create a new Sender Signature for a given email address. Note that you will need to "verify" this Sender Signature by following a link that will be emailed to the "fromEmail" address specified when calling this method.
public createSenderSignature ( string $fromEmail, string $name, string $replyToEmail = NULL, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel
$fromEmail string The email address for the Sender Signature
$name string The name of the Sender Signature.
$replyToEmail string The reply-to email address for the Sender Signature.
$returnPathDomain string The custom Return-Path domain for the Sender Signature.
return Postmark\Models\DynamicResponseModel

createServer() public method

Create a new Server. Any parameters passed with NULL will be ignored (their default values will be used).
public createServer ( string $name, string $color = NULL, boolean $rawEmailEnabled = NULL, boolean $smtpApiActivated = NULL, string $inboundHookUrl = NULL, string $bounceHookUrl = NULL, string $openHookUrl = NULL, boolean $postFirstOpenOnly = NULL, boolean $trackOpens = NULL, string $inboundDomain = NULL, integer $inboundSpamThreshold = NULL, string $trackLinks = NULL ) : Postmark\Models\DynamicResponseModel
$name string Set the name of the server.
$color string Set the color for the server in the Postmark WebUI (must be: 'purple', 'blue', 'turqoise', 'green', 'red', 'yellow', or 'grey')
$rawEmailEnabled boolean Enable raw email to be sent with inbound.
$smtpApiActivated boolean Specifies whether or not SMTP is enabled on this server.
$inboundHookUrl string URL to POST to everytime an inbound event occurs.
$bounceHookUrl string URL to POST to everytime a bounce event occurs.
$openHookUrl string URL to POST to everytime an open event occurs.
$postFirstOpenOnly boolean If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.
$trackOpens boolean Indicates if all emails being sent through this server have open tracking enabled.
$inboundDomain string Inbound domain for MX setup.
$inboundSpamThreshold integer The maximum spam score for an inbound message before it's blocked (range from 0-30).
$trackLinks string Indicates if all emails being sent through this server have link tracking enabled.
return Postmark\Models\DynamicResponseModel

deleteDomain() public method

Delete a Domain with the given ID.
public deleteDomain ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Domain we wish to delete.
return Postmark\Models\DynamicResponseModel

deleteSenderSignature() public method

Delete a Sender Signature with the given ID.
public deleteSenderSignature ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Sender Signature we wish to delete.
return Postmark\Models\DynamicResponseModel

deleteServer() public method

Delete a Server used for sending/receiving mail. NOTE: To protect your account, you'll need to contact support and request that they enable this feature on your account before you can use this client to delete Servers.
public deleteServer ( integer $id )
$id integer The ID of the Server to delete. :return DynamicResponseModel

editDomain() public method

Alter the properties of a Domain.
public editDomain ( integer $id, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Domain we wish to modify.
$returnPathDomain string The custom Return-Path domain for the Domain.
return Postmark\Models\DynamicResponseModel

editSenderSignature() public method

Alter the defaults for a Sender Signature.
public editSenderSignature ( integer $id, string $name = NULL, string $replyToEmail = NULL, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Sender Signature we wish to modify.
$name string The name of the Sender Signature.
$replyToEmail string The reply-to email address for the Sender Signature.
$returnPathDomain string The custom Return-Path domain for the Sender Signature.
return Postmark\Models\DynamicResponseModel

editServer() public method

Modify an existing Server. Any parameters passed with NULL will be ignored (their existing values will not be modified).
public editServer ( integer $id, string $name = NULL, string $color = NULL, boolean $rawEmailEnabled = NULL, boolean $smtpApiActivated = NULL, string $inboundHookUrl = NULL, string $bounceHookUrl = NULL, string $openHookUrl = NULL, boolean $postFirstOpenOnly = NULL, boolean $trackOpens = NULL, string $inboundDomain = NULL, integer $inboundSpamThreshold = NULL, string $trackLinks = NULL ) : Postmark\Models\DynamicResponseModel
$id integer The ID of the Server we wish to modify.
$name string Set the name of the server.
$color string Set the color for the server in the Postmark WebUI (must be: 'purple', 'blue', 'turqoise', 'green', 'red', 'yellow', or 'grey')
$rawEmailEnabled boolean Enable raw email to be sent with inbound.
$smtpApiActivated boolean Specifies whether or not SMTP is enabled on this server.
$inboundHookUrl string URL to POST to everytime an inbound event occurs.
$bounceHookUrl string URL to POST to everytime a bounce event occurs.
$openHookUrl string URL to POST to everytime an open event occurs.
$postFirstOpenOnly boolean If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.
$trackOpens boolean Indicates if all emails being sent through this server have open tracking enabled.
$inboundDomain string Inbound domain for MX setup.
$inboundSpamThreshold integer The maximum spam score for an inbound message before it's blocked (range from 0-30).
$trackLinks string Indicates if all emails being sent through this server have link tracking enabled.
return Postmark\Models\DynamicResponseModel

getDomain() public method

Get information for a specific Domain.
public getDomain ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Domains you wish to retrieve.
return Postmark\Models\DynamicResponseModel

getSenderSignature() public method

Get information for a specific Sender Signature.
public getSenderSignature ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Sender Signature you wish to retrieve.
return Postmark\Models\DynamicResponseModel

getServer() public method

Request a given server by ID.
public getServer ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The Id for the server you wish to retrieve.
return Postmark\Models\DynamicResponseModel

listDomains() public method

Get a "page" of Domains.
public listDomains ( integer $count = 100, $offset ) : Postmark\Models\DynamicResponseModel
$count integer The number of Domains to retrieve with this request. param integer $offset The number of Domains to 'skip' when 'paging' through them.
return Postmark\Models\DynamicResponseModel

listSenderSignatures() public method

Get a "page" of Sender Signatures.
public listSenderSignatures ( integer $count = 100, $offset ) : Postmark\Models\DynamicResponseModel
$count integer The number of Sender Signatures to retrieve with this request. param integer $offset The number of Sender Signatures to 'skip' when 'paging' through them.
return Postmark\Models\DynamicResponseModel

listServers() public method

Get a list of all servers configured on the account.
public listServers ( integer $count = 100, integer $offset, string $name = NULL ) : Postmark\Models\DynamicResponseModel
$count integer The number of servers to retrieve in the request, defaults to 100.
$offset integer The number of servers to "skip" when paging through lists of servers.
$name string Filter by server name.
return Postmark\Models\DynamicResponseModel

requestNewSenderSignatureDKIM() public method

Cause a new DKIM key to be generated and associated with the Sender Signature. This key must be added to your email domain's DNS records. Including DKIM is not required, but is recommended. For more information on DKIM and its purpose, see http://www.dkim.org/
Deprecation: rotateDKIMForDomain replaces this method.
public requestNewSenderSignatureDKIM ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Sender Signature for which we wish to get an updated DKIM configuration.
return Postmark\Models\DynamicResponseModel

resendSenderSignatureConfirmation() public method

Sender Signatures require verification before they may be used to send email through the Postmark API.
public resendSenderSignatureConfirmation ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Sender Signature to which we wish to resend a verification email.
return Postmark\Models\DynamicResponseModel

rotateDKIMForDomain() public method

Rotate DKIM keys associated with the Domain. This key must be added to your DNS records. Including DKIM is not required, but is recommended. For more information on DKIM and its purpose, see http://www.dkim.org/
public rotateDKIMForDomain ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Domain for which we wish to get an updated DKIM configuration.
return Postmark\Models\DynamicResponseModel

verifyDomainSPF() public method

Request that the Postmark API verify the SPF records associated with the Domain. Configuring SPF is not required to use Postmark, but it is highly recommended, and can improve delivery rates.
public verifyDomainSPF ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Domain for which we wish to verify the SPF records.
return Postmark\Models\DynamicResponseModel

verifySenderSignatureSPF() public method

Request that the Postmark API updates verify the SPF records associated with the Sender Signature's email address's domain. Configuring SPF is not required to use Postmark, but it is highly recommended, and can improve delivery rates.
Deprecation: verifyDomainSPF replaces this method
public verifySenderSignatureSPF ( integer $id ) : Postmark\Models\DynamicResponseModel
$id integer The ID for the Sender Signature for which we wish to verify the SPF records.
return Postmark\Models\DynamicResponseModel