Overview

Namespaces

  • Ctct
    • Auth
    • Components
      • Account
      • Activities
      • Contacts
      • EmailMarketing
      • Tracking
    • Exceptions
    • Services
  • PHP

Classes

  • AccountService
  • ActivityService
  • BaseService
  • CampaignScheduleService
  • CampaignTrackingService
  • ContactService
  • ContactTrackingService
  • EmailMarketingService
  • ListService
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Ctct\Services;
 3: 
 4: use Ctct\Util\RestClient;
 5: use Ctct\Util\Config;
 6: use Ctct\Components\Account\VerifiedEmailAddress;
 7: 
 8: /**
 9:  * Performs all actions pertaining to scheduling Constant Contact Account's
10:  *
11:  * @package     Services
12:  * @author         Constant Contact
13:  */
14: class AccountService extends BaseService
15: {
16: 
17:     /**
18:      * Get all verified email addresses associated with an account
19:      * @param $accessToken - Constant Contact OAuth2 Access Token
20:      * @return array of VerifiedEmailAddress 
21:      */
22:     public function getVerifiedEmailAddresses($accessToken)
23:     {
24:         $baseUrl = Config::get('endpoints.base_url')
25:             . sprintf(Config::get('endpoints.account_verified_addresses'));
26: 
27:         $url = $this->buildUrl($baseUrl);
28:         $response = parent::getRestClient()->get($url, parent::getHeaders($accessToken));
29:         
30:         $verifiedAddresses = array();
31:         
32:         foreach (json_decode($response->body, true) as $verifiedAddress) {
33:             $verifiedAddresses[] = VerifiedEmailAddress::create($verifiedAddress);
34:         }
35:         
36:         return $verifiedAddresses;
37:     }
38: }
39: 
Appconnect PHP SDK API documentation generated by ApiGen 2.8.0