diff options
Diffstat (limited to 'lib/SparkPost/Transmission.php')
-rw-r--r-- | lib/SparkPost/Transmission.php | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/lib/SparkPost/Transmission.php b/lib/SparkPost/Transmission.php index 4e54f1d..82cc11d 100644 --- a/lib/SparkPost/Transmission.php +++ b/lib/SparkPost/Transmission.php @@ -7,11 +7,11 @@ use Guzzle\Http\Exception\ClientErrorResponseException; * @desc SDK interface for managing transmissions */ class Transmission extends APIResource { - + public static $endpoint = 'transmissions'; - + /** - * @desc Mapping for values passed into the send method to the values needed for the Transmission API + * @desc Mapping for values passed into the send method to the values needed for the Transmission API * @var array */ protected static $parameterMappings = array( @@ -34,7 +34,7 @@ class Transmission extends APIResource { 'trackClicks'=>'options.click_tracking', 'useDraftTemplate'=>'use_draft_template' ); - + /** * @desc Sets up default structure and default values for the model that is acceptable by the API * @var array @@ -42,20 +42,20 @@ class Transmission extends APIResource { protected static $structure = array( 'return_path'=>"default@sparkpostmail.com", 'content'=>array( - 'html'=>null, + 'html'=>null, 'text'=>null, 'email_rfc822'=>null ), 'use_draft_template'=>false ); - + /** * @desc Method for issuing POST request to the Transmissions API * * This method assumes that all the appropriate fields have - * been populated by the user through configuration. Acceptable - * configuration values are: - * 'campaign': string, + * been populated by the user through configuration. Acceptable + * configuration values are: + * 'campaign': string, * 'metadata': array, * 'substitutionData': array, * 'description': string, @@ -71,42 +71,38 @@ class Transmission extends APIResource { * 'template': string, * 'trackOpens': boolean, * 'trackClicks': boolean, - * 'useDraftTemplate': boolean + * 'useDraftTemplate': boolean * * @return array API repsonse represented as key-value pairs */ public static function send( $transmissionConfig ) { - return self::sendRequest( $transmissionConfig ); + return self::create( $transmissionConfig ); } - + /** * @desc Method for retrieving information about all transmissions * Wrapper method for a cleaner interface - * + * * @return array result Set of transmissions */ public static function all( $campaignID=null, $templateID=null ) { $options = array(); if( $campaignID !== NULL ) $options['campaign_id'] = $campaignID; if( $templateID !== NULL ) $options['template_id'] = $templateID; - - return self::fetchResource( null, $options ); + + return self::get( null, $options ); } - + /** * @desc Method for retrieving information about a single transmission * Wrapper method for a cleaner interface - * + * * @param string $transmissionID Identifier of the transmission to be found * @return array result Single transmission represented in key-value pairs */ public static function find($transmissionID) { - return self::fetchResource($transmissionID); - } - - public static function delete( $transmissionID ) { - return self::deleteResource($transmissionID); + return self::get($transmissionID); } } -?>
\ No newline at end of file +?> |