CtCt
2 years ago
constantcontactv3
5 months ago
images
5 months ago
constantcontact.php
5 months ago
hustle-constantcontact-api-interface.php
5 months ago
hustle-constantcontact-api-v2-non-hub.php
5 months ago
hustle-constantcontact-api-v2.php
5 months ago
hustle-constantcontact-api.php
5 months ago
hustle-constantcontact-form-hooks.php
5 months ago
hustle-constantcontact-form-settings.php
5 months ago
hustle-constantcontact-oauth.php
5 months ago
hustle-constantcontact.php
5 months ago
hustle-constantcontact-api-interface.php
139 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Hustle ConstantContact API Interface |
| 4 | * |
| 5 | * @package Hustle |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Interface Hustle_ConstantContact_Api_Interface |
| 10 | */ |
| 11 | |
| 12 | interface Hustle_ConstantContact_Api_Interface { |
| 13 | /** |
| 14 | * Listen to request callback sent from WPMUDEV. |
| 15 | * |
| 16 | * @return void |
| 17 | */ |
| 18 | public function process_callback_request(); |
| 19 | |
| 20 | /** |
| 21 | * Generates authorization URL. |
| 22 | * |
| 23 | * @param int $module_id Module ID. |
| 24 | * @param bool $log_referrer Log referrer. |
| 25 | * @param string $page Page. |
| 26 | * @return string |
| 27 | */ |
| 28 | public function get_authorization_uri( $module_id = 0, $log_referrer = true, $page = 'hustle_embedded' ); |
| 29 | |
| 30 | /** |
| 31 | * Get token value by key. |
| 32 | * |
| 33 | * @param string $key Key. |
| 34 | * @return bool|mixed |
| 35 | */ |
| 36 | public function get_token( $key ); |
| 37 | |
| 38 | /** |
| 39 | * Compose redirect_uri to use on request argument. |
| 40 | * |
| 41 | * @return string |
| 42 | */ |
| 43 | public function get_redirect_uri(); |
| 44 | |
| 45 | /** |
| 46 | * Get access token from code. |
| 47 | * |
| 48 | * @param string $code Code. |
| 49 | * @return bool |
| 50 | */ |
| 51 | public function get_access_token( $code ); |
| 52 | |
| 53 | /** |
| 54 | * Get stored token data. |
| 55 | * |
| 56 | * @return array|null |
| 57 | */ |
| 58 | public function get_auth_token(); |
| 59 | |
| 60 | /** |
| 61 | * Update token data. |
| 62 | * |
| 63 | * @param array $token Token. |
| 64 | * @return void |
| 65 | */ |
| 66 | public function update_auth_token( array $token ); |
| 67 | |
| 68 | /** |
| 69 | * Get current account information. |
| 70 | * |
| 71 | * @return object |
| 72 | */ |
| 73 | public function get_account_info(); |
| 74 | |
| 75 | /** |
| 76 | * Retrieve contact lists from ConstantContact. |
| 77 | * |
| 78 | * @return array |
| 79 | */ |
| 80 | public function get_contact_lists(); |
| 81 | |
| 82 | /** |
| 83 | * Retrieve contact from ConstantContact. |
| 84 | * |
| 85 | * @param string $email Email. |
| 86 | * @return false|object |
| 87 | */ |
| 88 | public function get_contact( $email ); |
| 89 | |
| 90 | /** |
| 91 | * Check if contact exists in certain list. |
| 92 | * |
| 93 | * @param object $contact Contact object. |
| 94 | * @param string $list_id List ID. |
| 95 | * @return bool |
| 96 | */ |
| 97 | public function contact_exist( $contact, $list_id ); |
| 98 | |
| 99 | /** |
| 100 | * Subscribe contact. |
| 101 | * |
| 102 | * @param string $email Email. |
| 103 | * @param string $first_name First name. |
| 104 | * @param string $last_name Last name. |
| 105 | * @param string $target_list Constant contact list. |
| 106 | * @param array $custom_fields Custom fields. |
| 107 | * @return mixed |
| 108 | */ |
| 109 | public function subscribe( $email, $first_name, $last_name, $target_list, $custom_fields = array() ); |
| 110 | |
| 111 | /** |
| 112 | * Remove wp_options rows. |
| 113 | * |
| 114 | * @return void |
| 115 | */ |
| 116 | public function remove_wp_options(); |
| 117 | |
| 118 | /** |
| 119 | * Update Subscription. |
| 120 | * |
| 121 | * @param object $contact Contact. |
| 122 | * @param string $first_name First name. |
| 123 | * @param string $last_name Last name. |
| 124 | * @param string $target_list Constant contact list. |
| 125 | * @param array $custom_fields Custom fields. |
| 126 | * @return mixed |
| 127 | */ |
| 128 | public function update_subscription( $contact, $first_name, $last_name, $target_list, $custom_fields = array() ); |
| 129 | |
| 130 | /** |
| 131 | * Delete subscriber from the list. |
| 132 | * |
| 133 | * @param string $list_id List ID. |
| 134 | * @param string $email Email. |
| 135 | * @return bool |
| 136 | */ |
| 137 | public function delete_email( $list_id, $email ); |
| 138 | } |
| 139 |