Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremeamia committed May 15, 2012
1 parent 1605502 commit 6e25eb3
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 20 deletions.
12 changes: 12 additions & 0 deletions _docs/CHANGELOG.md
@@ -1,3 +1,15 @@
# Changelog: 1.5.6 "Gershwin"
Code name for Apple's never-released successor to the never-released Copeland. <http://en.wikipedia.org/wiki/Gershwin_operating_system>

Launched Tuesday, May 15th, 2012.

## Services
### AmazonSES
- **New:** Support for domain verification has been added to the SDK, which enables customers to verify an entire email domain.
- **New:** Requests to this service are now signed with Signature V4.

----

# Changelog: 1.5.5 "Fishhead"
Code name for the Apple II File Mangement Utility. <http://applemuseum.bott.org/sections/codenames.html>

Expand Down
2 changes: 1 addition & 1 deletion authentication/signature_v4query.class.php
Expand Up @@ -283,7 +283,7 @@ protected function region()
protected function service()
{
$pieces = explode('.', $this->endpoint);
return $pieces[0];
return ($pieces[0] === 'email') ? 'ses' : $pieces[0];
}

/**
Expand Down
16 changes: 8 additions & 8 deletions package.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sdk.class.php
Expand Up @@ -115,8 +115,8 @@ function __aws_sdk_ua_callback()
// INTERMEDIARY CONSTANTS

define('CFRUNTIME_NAME', 'aws-sdk-php');
define('CFRUNTIME_VERSION', '1.5.5');
define('CFRUNTIME_BUILD', '20120509180000');
define('CFRUNTIME_VERSION', 'Gershwin');
define('CFRUNTIME_BUILD', '20120515180000');
define('CFRUNTIME_USERAGENT', CFRUNTIME_NAME . '/' . CFRUNTIME_VERSION . ' PHP/' . PHP_VERSION . ' ' . str_replace(' ', '_', php_uname('s')) . '/' . str_replace(' ', '_', php_uname('r')) . ' Arch/' . php_uname('m') . ' SAPI/' . php_sapi_name() . ' Integer/' . PHP_INT_MAX . ' Build/' . CFRUNTIME_BUILD . __aws_sdk_ua_callback());


Expand Down
128 changes: 119 additions & 9 deletions services/ses.class.php
Expand Up @@ -26,7 +26,7 @@
* The endpoint for Amazon SES is located at: <code>https://email.us-east-1.amazonaws.com</code>
* </p>
*
* @version 2012.04.18
* @version 2012.05.14
* @license See the included NOTICE.md file for complete information.
* @copyright See the included NOTICE.md file for complete information.
* @link http://aws.amazon.com/ses/ Amazon Simple Email Service
Expand Down Expand Up @@ -72,7 +72,7 @@ public function __construct(array $options = array())
{
$this->api_version = '2010-12-01';
$this->hostname = self::DEFAULT_URL;
$this->auth_class = 'AuthV3Query';
$this->auth_class = 'AuthV4Query';

return parent::__construct($options);
}
Expand Down Expand Up @@ -113,10 +113,32 @@ public function disable_ssl()
/*%******************************************************************************************%*/
// SERVICE METHODS

/**
* Deletes the specified identity (email address or domain) from the list of verified identities.
*
* @param string $identity (Required) The identity to be removed from the list of identities for the AWS Account.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
*/
public function delete_identity($identity, $opt = null)
{
if (!$opt) $opt = array();
$opt['Identity'] = $identity;

return $this->authenticate('DeleteIdentity', $opt);
}

/**
* Deletes the specified email address from the list of verified addresses.
*
* <p class="important">
* The DeleteVerifiedEmailAddress action is deprecated as of the May 15, 2012 release of Domain
* Verification. The DeleteIdentity action is now preferred.
* </p>
*
* @param string $email_address (Required) An email address to be removed from the list of verified addreses.
* @param string $email_address (Required) An email address to be removed from the list of verified addresses.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
Expand All @@ -130,6 +152,28 @@ public function delete_verified_email_address($email_address, $opt = null)
return $this->authenticate('DeleteVerifiedEmailAddress', $opt);
}

/**
* Given a list of identities (email addresses and/or domains), returns the verification status
* and (for domain identities) the verification token for each identity.
*
* @param string|array $identities (Required) A list of identities. Pass a string for a single value, or an indexed array for multiple values.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
*/
public function get_identity_verification_attributes($identities, $opt = null)
{
if (!$opt) $opt = array();

// Required list (non-map)
$opt = array_merge($opt, CFComplexType::map(array(
'Identities' => (is_array($identities) ? $identities : array($identities))
), 'member'));

return $this->authenticate('GetIdentityVerificationAttributes', $opt);
}

/**
* Returns the user's current sending limits.
*
Expand Down Expand Up @@ -163,8 +207,32 @@ public function get_send_statistics($opt = null)
return $this->authenticate('GetSendStatistics', $opt);
}

/**
* Returns a list containing all of the identities (email addresses and domains) for a specific
* AWS Account, regardless of verification status.
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>IdentityType</code> - <code>string</code> - Optional - The type of the identities to list. Possible values are "EmailAddress" and "Domain". If this parameter is omitted, then all identities will be listed. [Allowed values: <code>EmailAddress</code>, <code>Domain</code>]</li>
* <li><code>NextToken</code> - <code>string</code> - Optional - The token to use for pagination.</li>
* <li><code>MaxItems</code> - <code>integer</code> - Optional - The maximum number of identities per page. Possible values are 1-100 inclusive.</li>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
*/
public function list_identities($opt = null)
{
if (!$opt) $opt = array();

return $this->authenticate('ListIdentities', $opt);
}

/**
* Returns a list containing all of the email addresses that have been verified.
*
* <p class="important">
* The ListVerifiedEmailAddresses action is deprecated as of the May 15, 2012 release of Domain
* Verification. The ListIdentities action is now preferred.
* </p>
*
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
Expand All @@ -184,8 +252,9 @@ public function list_verified_email_addresses($opt = null)
*
* <p class="important">
* If you have not yet requested production access to Amazon SES, then you will only be able to
* send email to and from verified email addresses. For more information, go to the <a href=
* "http://docs.amazonwebservices.com/ses/latest/DeveloperGuide">Amazon SES Developer Guide</a>.
* send email to and from verified email addresses and domains. For more information, go to the
* <a href="http://docs.amazonwebservices.com/ses/latest/DeveloperGuide">Amazon SES Developer
* Guide</a>.
* </p>
* The total size of the message cannot exceed 10 MB.
*
Expand All @@ -200,7 +269,7 @@ public function list_verified_email_addresses($opt = null)
* section of the <a href="http://docs.amazonwebservices.com/ses/latest/DeveloperGuide">Amazon SES
* Developer Guide</a>.
*
* @param string $source (Required) The sender's email address.
* @param string $source (Required) The identity's email address.
* @param array $destination (Required) The destination for this email, composed of To:, CC:, and BCC: fields. <ul>
* <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
* <li><code>ToAddresses</code> - <code>string|array</code> - Optional - The To: field(s) of the message. Pass a string for a single value, or an indexed array for multiple values.</li>
Expand Down Expand Up @@ -275,8 +344,9 @@ public function send_email($source, $destination, $message, $opt = null)
*
* <p class="important">
* If you have not yet requested production access to Amazon SES, then you will only be able to
* send email to and from verified email addresses. For more information, go to the <a href=
* "http://docs.amazonwebservices.com/ses/latest/DeveloperGuide">Amazon SES Developer Guide</a>.
* send email to and from verified email addresses and domains. For more information, go to the
* <a href="http://docs.amazonwebservices.com/ses/latest/DeveloperGuide">Amazon SES Developer
* Guide</a>.
* </p>
* The total size of the message cannot exceed 10 MB. This includes any attachments that are part
* of the message.
Expand All @@ -298,7 +368,7 @@ public function send_email($source, $destination, $message, $opt = null)
* </ul></li>
* </ul>
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>Source</code> - <code>string</code> - Optional - The sender's email address. <p class="note">If you specify the <code>Source</code> parameter, then bounce notifications and complaints will be sent to this email address. This takes precedence over any <em>Return-Path</em> header that you might include in the raw text of the message.</p></li>
* <li><code>Source</code> - <code>string</code> - Optional - The identity's email address. <p class="note">If you specify the <code>Source</code> parameter, then bounce notifications and complaints will be sent to this email address. This takes precedence over any <em>Return-Path</em> header that you might include in the raw text of the message.</p></li>
* <li><code>Destinations</code> - <code>string|array</code> - Optional - A list of destinations for the message. Pass a string for a single value, or an indexed array for multiple values.</li>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
Expand All @@ -325,9 +395,31 @@ public function send_raw_email($raw_message, $opt = null)
return $this->authenticate('SendRawEmail', $opt);
}

/**
* Verifies a domain.
*
* @param string $domain (Required) The domain to be verified.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
*/
public function verify_domain_identity($domain, $opt = null)
{
if (!$opt) $opt = array();
$opt['Domain'] = $domain;

return $this->authenticate('VerifyDomainIdentity', $opt);
}

/**
* Verifies an email address. This action causes a confirmation email message to be sent to the
* specified address.
*
* <p class="important">
* The VerifyEmailAddress action is deprecated as of the May 15, 2012 release of Domain
* Verification. The VerifyEmailIdentity action is now preferred.
* </p>
*
* @param string $email_address (Required) The email address to be verified.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
Expand All @@ -342,6 +434,24 @@ public function verify_email_address($email_address, $opt = null)

return $this->authenticate('VerifyEmailAddress', $opt);
}

/**
* Verifies an email address. This action causes a confirmation email message to be sent to the
* specified address.
*
* @param string $email_address (Required) The email address to be verified.
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
* <li><code>returnCurlHandle</code> - <code>boolean</code> - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.</li></ul>
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
*/
public function verify_email_identity($email_address, $opt = null)
{
if (!$opt) $opt = array();
$opt['EmailAddress'] = $email_address;

return $this->authenticate('VerifyEmailIdentity', $opt);
}
}


Expand Down

0 comments on commit 6e25eb3

Please sign in to comment.