Class PostalMethods
PostalMethods service for physically mailing letters
Methods summary
public
|
#
__construct( )
Constructs a new PostalMethods component
Constructs a new PostalMethods component
|
public
|
#
setApiKey( string $api_key )
Sets the Postal Methods API Key required for making requests
Sets the Postal Methods API Key required for making requests
Parameters
- $api_key
- The Postal Methods API key
|
public
|
#
setFile( array $file )
Sets the file and file type of the file to be mailed
Sets the file and file type of the file to be mailed
Parameters
- $file
A key=>value array of the file and it's extension:
- file The bitstream of the file to send in binary
- type The type of file this is (i.e. HTML, DOC, DOCX, or PDF), (optional, default PDF)
|
public
|
#
setToAddress( array $address )
Sets the outside address
Parameters
- $address
A list of attributes attributes including:
- name The name of the recipient
- company The company name
- address1 Address1
- address2 Address2
- city The city
- state The ISO 3166-2 subdivision code
- zip The postal code
- country_code The ISO 3166-1 alpha3 country code
|
public
|
#
setReplyEnvelope( boolean $include_reply_envelope )
Sets a reply envelope to be included in the mail
Sets a reply envelope to be included in the mail
Parameters
- $include_reply_envelope
True to include a reply envelope in the mail,
false to not include a reply envelope
See
Notes
An address must be explicitly set in order to include a reply envelope
|
public
|
#
setColored( boolean $colored )
Sets whether to print in color
Sets whether to print in color
Parameters
- $colored
- True to print in color, false to print in black-and-white
|
public
|
#
setDoubleSided( boolean $double_sided )
Sets whether to print on both sides of a page
Sets whether to print on both sides of a page
Parameters
- $double_sided
- True to print on both sides of a page, false to print on one
|
public
|
#
setPerforated( boolean $perforated )
Sets whether the bottom-third of the letter sent to PostalMethods should
be perforated
Sets whether the bottom-third of the letter sent to PostalMethods should
be perforated
Parameters
- $perforated
True to have the bottom-third of the letter perforated,
false to not perforate the letter
See
Notes
An address must be explicitly set in order to have this letter perforated
|
public
|
#
setDescription( string $description )
Sets a description to associate with this letter in the PostalMethods account
Sets a description to associate with this letter in the PostalMethods account
Parameters
- $description
- A description to associate with this letter. Limit 100 characters
|
public
array
|
#
getFileTypes( )
Retrieves a list of available file types accepted by Postal Methods
Retrieves a list of available file types accepted by Postal Methods
Returns
array A numerically-indexed array of available file types
|
public
|
#
resetAll( )
Resets all settings back to default except for the account username and password
Resets all settings back to default except for the account username and password
|
public
|
#
send( )
Sends the document to Postal Methods for mailing
Sends the document to Postal Methods for mailing
|
public
array
|
#
errors( )
Returns all errors set in this object
Returns all errors set in this object
Returns
array An array of error info
|