@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | try { |
| 21 | 21 | $response = $sg->client->asm()->groups()->post($request_body); |
| 22 | - print $response->statusCode() . "\n"; |
|
| 22 | + print $response->statusCode()."\n"; |
|
| 23 | 23 | print_r($response->headers()); |
| 24 | - print $response->body() . "\n"; |
|
| 24 | + print $response->body()."\n"; |
|
| 25 | 25 | } catch (Exception $e) { |
| 26 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 26 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | //////////////////////////////////////////////////// |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | try { |
| 36 | 36 | $response = $sg->client->asm()->groups()->get(null, $query_params); |
| 37 | - print $response->statusCode() . "\n"; |
|
| 37 | + print $response->statusCode()."\n"; |
|
| 38 | 38 | print_r($response->headers()); |
| 39 | - print $response->body() . "\n"; |
|
| 39 | + print $response->body()."\n"; |
|
| 40 | 40 | } catch (Exception $e) { |
| 41 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 41 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | //////////////////////////////////////////////////// |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | try { |
| 56 | 56 | $response = $sg->client->asm()->groups()->_($group_id)->patch($request_body); |
| 57 | - print $response->statusCode() . "\n"; |
|
| 57 | + print $response->statusCode()."\n"; |
|
| 58 | 58 | print_r($response->headers()); |
| 59 | - print $response->body() . "\n"; |
|
| 59 | + print $response->body()."\n"; |
|
| 60 | 60 | } catch (Exception $e) { |
| 61 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 61 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | //////////////////////////////////////////////////// |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | try { |
| 71 | 71 | $response = $sg->client->asm()->groups()->_($group_id)->get(); |
| 72 | - print $response->statusCode() . "\n"; |
|
| 72 | + print $response->statusCode()."\n"; |
|
| 73 | 73 | print_r($response->headers()); |
| 74 | - print $response->body() . "\n"; |
|
| 74 | + print $response->body()."\n"; |
|
| 75 | 75 | } catch (Exception $e) { |
| 76 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 76 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | //////////////////////////////////////////////////// |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | try { |
| 86 | 86 | $response = $sg->client->asm()->groups()->_($group_id)->delete(); |
| 87 | - print $response->statusCode() . "\n"; |
|
| 87 | + print $response->statusCode()."\n"; |
|
| 88 | 88 | print_r($response->headers()); |
| 89 | - print $response->body() . "\n"; |
|
| 89 | + print $response->body()."\n"; |
|
| 90 | 90 | } catch (Exception $e) { |
| 91 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 91 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | //////////////////////////////////////////////////// |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | try { |
| 107 | 107 | $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->post($request_body); |
| 108 | - print $response->statusCode() . "\n"; |
|
| 108 | + print $response->statusCode()."\n"; |
|
| 109 | 109 | print_r($response->headers()); |
| 110 | - print $response->body() . "\n"; |
|
| 110 | + print $response->body()."\n"; |
|
| 111 | 111 | } catch (Exception $e) { |
| 112 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 112 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | //////////////////////////////////////////////////// |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | try { |
| 122 | 122 | $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->get(); |
| 123 | - print $response->statusCode() . "\n"; |
|
| 123 | + print $response->statusCode()."\n"; |
|
| 124 | 124 | print_r($response->headers()); |
| 125 | - print $response->body() . "\n"; |
|
| 125 | + print $response->body()."\n"; |
|
| 126 | 126 | } catch (Exception $e) { |
| 127 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 127 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | //////////////////////////////////////////////////// |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | try { |
| 144 | 144 | $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->search()->post($request_body); |
| 145 | - print $response->statusCode() . "\n"; |
|
| 145 | + print $response->statusCode()."\n"; |
|
| 146 | 146 | print_r($response->headers()); |
| 147 | - print $response->body() . "\n"; |
|
| 147 | + print $response->body()."\n"; |
|
| 148 | 148 | } catch (Exception $e) { |
| 149 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 149 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | //////////////////////////////////////////////////// |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | try { |
| 160 | 160 | $response = $sg->client->asm()->groups()->_($group_id)->suppressions()->_($email)->delete(); |
| 161 | - print $response->statusCode() . "\n"; |
|
| 161 | + print $response->statusCode()."\n"; |
|
| 162 | 162 | print_r($response->headers()); |
| 163 | - print $response->body() . "\n"; |
|
| 163 | + print $response->body()."\n"; |
|
| 164 | 164 | } catch (Exception $e) { |
| 165 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 165 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | //////////////////////////////////////////////////// |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | try { |
| 174 | 174 | $response = $sg->client->asm()->suppressions()->get(); |
| 175 | - print $response->statusCode() . "\n"; |
|
| 175 | + print $response->statusCode()."\n"; |
|
| 176 | 176 | print_r($response->headers()); |
| 177 | - print $response->body() . "\n"; |
|
| 177 | + print $response->body()."\n"; |
|
| 178 | 178 | } catch (Exception $e) { |
| 179 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 179 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | //////////////////////////////////////////////////// |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | try { |
| 194 | 194 | $response = $sg->client->asm()->suppressions()->global()->post($request_body); |
| 195 | - print $response->statusCode() . "\n"; |
|
| 195 | + print $response->statusCode()."\n"; |
|
| 196 | 196 | print_r($response->headers()); |
| 197 | - print $response->body() . "\n"; |
|
| 197 | + print $response->body()."\n"; |
|
| 198 | 198 | } catch (Exception $e) { |
| 199 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 199 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | //////////////////////////////////////////////////// |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | try { |
| 209 | 209 | $response = $sg->client->asm()->suppressions()->global()->_($email)->get(); |
| 210 | - print $response->statusCode() . "\n"; |
|
| 210 | + print $response->statusCode()."\n"; |
|
| 211 | 211 | print_r($response->headers()); |
| 212 | - print $response->body() . "\n"; |
|
| 212 | + print $response->body()."\n"; |
|
| 213 | 213 | } catch (Exception $e) { |
| 214 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 214 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | //////////////////////////////////////////////////// |
@@ -222,11 +222,11 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | try { |
| 224 | 224 | $response = $sg->client->asm()->suppressions()->global()->_($email)->delete(); |
| 225 | - print $response->statusCode() . "\n"; |
|
| 225 | + print $response->statusCode()."\n"; |
|
| 226 | 226 | print_r($response->headers()); |
| 227 | - print $response->body() . "\n"; |
|
| 227 | + print $response->body()."\n"; |
|
| 228 | 228 | } catch (Exception $e) { |
| 229 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 229 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | //////////////////////////////////////////////////// |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | try { |
| 239 | 239 | $response = $sg->client->asm()->suppressions()->_($email)->get(); |
| 240 | - print $response->statusCode() . "\n"; |
|
| 240 | + print $response->statusCode()."\n"; |
|
| 241 | 241 | print_r($response->headers()); |
| 242 | - print $response->body() . "\n"; |
|
| 242 | + print $response->body()."\n"; |
|
| 243 | 243 | } catch (Exception $e) { |
| 244 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 244 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 245 | 245 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | try { |
| 17 | 17 | $response = $sg->client->tracking_settings()->get(null, $query_params); |
| 18 | - print $response->statusCode() . "\n"; |
|
| 18 | + print $response->statusCode()."\n"; |
|
| 19 | 19 | print_r($response->headers()); |
| 20 | - print $response->body() . "\n"; |
|
| 20 | + print $response->body()."\n"; |
|
| 21 | 21 | } catch (Exception $e) { |
| 22 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 22 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | //////////////////////////////////////////////////// |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | try { |
| 34 | 34 | $response = $sg->client->tracking_settings()->click()->patch($request_body); |
| 35 | - print $response->statusCode() . "\n"; |
|
| 35 | + print $response->statusCode()."\n"; |
|
| 36 | 36 | print_r($response->headers()); |
| 37 | - print $response->body() . "\n"; |
|
| 37 | + print $response->body()."\n"; |
|
| 38 | 38 | } catch (Exception $e) { |
| 39 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 39 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | //////////////////////////////////////////////////// |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | try { |
| 47 | 47 | $response = $sg->client->tracking_settings()->click()->get(); |
| 48 | - print $response->statusCode() . "\n"; |
|
| 48 | + print $response->statusCode()."\n"; |
|
| 49 | 49 | print_r($response->headers()); |
| 50 | - print $response->body() . "\n"; |
|
| 50 | + print $response->body()."\n"; |
|
| 51 | 51 | } catch (Exception $e) { |
| 52 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 52 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | //////////////////////////////////////////////////// |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | try { |
| 69 | 69 | $response = $sg->client->tracking_settings()->google_analytics()->patch($request_body); |
| 70 | - print $response->statusCode() . "\n"; |
|
| 70 | + print $response->statusCode()."\n"; |
|
| 71 | 71 | print_r($response->headers()); |
| 72 | - print $response->body() . "\n"; |
|
| 72 | + print $response->body()."\n"; |
|
| 73 | 73 | } catch (Exception $e) { |
| 74 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 74 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | //////////////////////////////////////////////////// |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | try { |
| 82 | 82 | $response = $sg->client->tracking_settings()->google_analytics()->get(); |
| 83 | - print $response->statusCode() . "\n"; |
|
| 83 | + print $response->statusCode()."\n"; |
|
| 84 | 84 | print_r($response->headers()); |
| 85 | - print $response->body() . "\n"; |
|
| 85 | + print $response->body()."\n"; |
|
| 86 | 86 | } catch (Exception $e) { |
| 87 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 87 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | //////////////////////////////////////////////////// |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | try { |
| 99 | 99 | $response = $sg->client->tracking_settings()->open()->patch($request_body); |
| 100 | - print $response->statusCode() . "\n"; |
|
| 100 | + print $response->statusCode()."\n"; |
|
| 101 | 101 | print_r($response->headers()); |
| 102 | - print $response->body() . "\n"; |
|
| 102 | + print $response->body()."\n"; |
|
| 103 | 103 | } catch (Exception $e) { |
| 104 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 104 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | //////////////////////////////////////////////////// |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | try { |
| 112 | 112 | $response = $sg->client->tracking_settings()->open()->get(); |
| 113 | - print $response->statusCode() . "\n"; |
|
| 113 | + print $response->statusCode()."\n"; |
|
| 114 | 114 | print_r($response->headers()); |
| 115 | - print $response->body() . "\n"; |
|
| 115 | + print $response->body()."\n"; |
|
| 116 | 116 | } catch (Exception $e) { |
| 117 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 117 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | //////////////////////////////////////////////////// |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | try { |
| 134 | 134 | $response = $sg->client->tracking_settings()->subscription()->patch($request_body); |
| 135 | - print $response->statusCode() . "\n"; |
|
| 135 | + print $response->statusCode()."\n"; |
|
| 136 | 136 | print_r($response->headers()); |
| 137 | - print $response->body() . "\n"; |
|
| 137 | + print $response->body()."\n"; |
|
| 138 | 138 | } catch (Exception $e) { |
| 139 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 139 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | //////////////////////////////////////////////////// |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | try { |
| 147 | 147 | $response = $sg->client->tracking_settings()->subscription()->get(); |
| 148 | - print $response->statusCode() . "\n"; |
|
| 148 | + print $response->statusCode()."\n"; |
|
| 149 | 149 | print_r($response->headers()); |
| 150 | - print $response->body() . "\n"; |
|
| 150 | + print $response->body()."\n"; |
|
| 151 | 151 | } catch (Exception $e) { |
| 152 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 152 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 153 | 153 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | try { |
| 17 | 17 | $response = $sg->client->partner_settings()->get(null, $query_params); |
| 18 | - print $response->statusCode() . "\n"; |
|
| 18 | + print $response->statusCode()."\n"; |
|
| 19 | 19 | print_r($response->headers()); |
| 20 | - print $response->body() . "\n"; |
|
| 20 | + print $response->body()."\n"; |
|
| 21 | 21 | } catch (Exception $e) { |
| 22 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 22 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | //////////////////////////////////////////////////// |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | try { |
| 36 | 36 | $response = $sg->client->partner_settings()->new_relic()->patch($request_body); |
| 37 | - print $response->statusCode() . "\n"; |
|
| 37 | + print $response->statusCode()."\n"; |
|
| 38 | 38 | print_r($response->headers()); |
| 39 | - print $response->body() . "\n"; |
|
| 39 | + print $response->body()."\n"; |
|
| 40 | 40 | } catch (Exception $e) { |
| 41 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 41 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | //////////////////////////////////////////////////// |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | try { |
| 50 | 50 | $response = $sg->client->partner_settings()->new_relic()->get(); |
| 51 | - print $response->statusCode() . "\n"; |
|
| 51 | + print $response->statusCode()."\n"; |
|
| 52 | 52 | print_r($response->headers()); |
| 53 | - print $response->body() . "\n"; |
|
| 53 | + print $response->body()."\n"; |
|
| 54 | 54 | } catch (Exception $e) { |
| 55 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 55 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 56 | 56 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | try { |
| 36 | 36 | $response = $sg->client->campaigns()->post($request_body); |
| 37 | - print $response->statusCode() . "\n"; |
|
| 37 | + print $response->statusCode()."\n"; |
|
| 38 | 38 | print_r($response->headers()); |
| 39 | - print $response->body() . "\n"; |
|
| 39 | + print $response->body()."\n"; |
|
| 40 | 40 | } catch (Exception $e) { |
| 41 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 41 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | //////////////////////////////////////////////////// |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | try { |
| 51 | 51 | $response = $sg->client->campaigns()->get(null, $query_params); |
| 52 | - print $response->statusCode() . "\n"; |
|
| 52 | + print $response->statusCode()."\n"; |
|
| 53 | 53 | print_r($response->headers()); |
| 54 | - print $response->body() . "\n"; |
|
| 54 | + print $response->body()."\n"; |
|
| 55 | 55 | } catch (Exception $e) { |
| 56 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 56 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | //////////////////////////////////////////////////// |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | try { |
| 75 | 75 | $response = $sg->client->campaigns()->_($campaign_id)->patch($request_body); |
| 76 | - print $response->statusCode() . "\n"; |
|
| 76 | + print $response->statusCode()."\n"; |
|
| 77 | 77 | print_r($response->headers()); |
| 78 | - print $response->body() . "\n"; |
|
| 78 | + print $response->body()."\n"; |
|
| 79 | 79 | } catch (Exception $e) { |
| 80 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 80 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | //////////////////////////////////////////////////// |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | try { |
| 90 | 90 | $response = $sg->client->campaigns()->_($campaign_id)->get(); |
| 91 | - print $response->statusCode() . "\n"; |
|
| 91 | + print $response->statusCode()."\n"; |
|
| 92 | 92 | print_r($response->headers()); |
| 93 | - print $response->body() . "\n"; |
|
| 93 | + print $response->body()."\n"; |
|
| 94 | 94 | } catch (Exception $e) { |
| 95 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 95 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | //////////////////////////////////////////////////// |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | try { |
| 105 | 105 | $response = $sg->client->campaigns()->_($campaign_id)->delete(); |
| 106 | - print $response->statusCode() . "\n"; |
|
| 106 | + print $response->statusCode()."\n"; |
|
| 107 | 107 | print_r($response->headers()); |
| 108 | - print $response->body() . "\n"; |
|
| 108 | + print $response->body()."\n"; |
|
| 109 | 109 | } catch (Exception $e) { |
| 110 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 110 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | //////////////////////////////////////////////////// |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | try { |
| 123 | 123 | $response = $sg->client->campaigns()->_($campaign_id)->schedules()->patch($request_body); |
| 124 | - print $response->statusCode() . "\n"; |
|
| 124 | + print $response->statusCode()."\n"; |
|
| 125 | 125 | print_r($response->headers()); |
| 126 | - print $response->body() . "\n"; |
|
| 126 | + print $response->body()."\n"; |
|
| 127 | 127 | } catch (Exception $e) { |
| 128 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 128 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | //////////////////////////////////////////////////// |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | try { |
| 141 | 141 | $response = $sg->client->campaigns()->_($campaign_id)->schedules()->post($request_body); |
| 142 | - print $response->statusCode() . "\n"; |
|
| 142 | + print $response->statusCode()."\n"; |
|
| 143 | 143 | print_r($response->headers()); |
| 144 | - print $response->body() . "\n"; |
|
| 144 | + print $response->body()."\n"; |
|
| 145 | 145 | } catch (Exception $e) { |
| 146 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 146 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | //////////////////////////////////////////////////// |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | try { |
| 156 | 156 | $response = $sg->client->campaigns()->_($campaign_id)->schedules()->get(); |
| 157 | - print $response->statusCode() . "\n"; |
|
| 157 | + print $response->statusCode()."\n"; |
|
| 158 | 158 | print_r($response->headers()); |
| 159 | - print $response->body() . "\n"; |
|
| 159 | + print $response->body()."\n"; |
|
| 160 | 160 | } catch (Exception $e) { |
| 161 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 161 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | //////////////////////////////////////////////////// |
@@ -169,11 +169,11 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | try { |
| 171 | 171 | $response = $sg->client->campaigns()->_($campaign_id)->schedules()->delete(); |
| 172 | - print $response->statusCode() . "\n"; |
|
| 172 | + print $response->statusCode()."\n"; |
|
| 173 | 173 | print_r($response->headers()); |
| 174 | - print $response->body() . "\n"; |
|
| 174 | + print $response->body()."\n"; |
|
| 175 | 175 | } catch (Exception $e) { |
| 176 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 176 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | //////////////////////////////////////////////////// |
@@ -184,11 +184,11 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | try { |
| 186 | 186 | $response = $sg->client->campaigns()->_($campaign_id)->schedules()->now()->post(); |
| 187 | - print $response->statusCode() . "\n"; |
|
| 187 | + print $response->statusCode()."\n"; |
|
| 188 | 188 | print_r($response->headers()); |
| 189 | - print $response->body() . "\n"; |
|
| 189 | + print $response->body()."\n"; |
|
| 190 | 190 | } catch (Exception $e) { |
| 191 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 191 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | //////////////////////////////////////////////////// |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | try { |
| 204 | 204 | $response = $sg->client->campaigns()->_($campaign_id)->schedules()->test()->post($request_body); |
| 205 | - print $response->statusCode() . "\n"; |
|
| 205 | + print $response->statusCode()."\n"; |
|
| 206 | 206 | print_r($response->headers()); |
| 207 | - print $response->body() . "\n"; |
|
| 207 | + print $response->body()."\n"; |
|
| 208 | 208 | } catch (Exception $e) { |
| 209 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 209 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 210 | 210 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | try { |
| 17 | 17 | $response = $sg->client->browsers()->stats()->get(null, $query_params); |
| 18 | - print $response->statusCode() . "\n"; |
|
| 18 | + print $response->statusCode()."\n"; |
|
| 19 | 19 | print_r($response->headers()); |
| 20 | - print $response->body() . "\n"; |
|
| 20 | + print $response->body()."\n"; |
|
| 21 | 21 | } catch (Exception $e) { |
| 22 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 22 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 23 | 23 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | try { |
| 17 | 17 | $response = $sg->client->stats()->get(null, $query_params); |
| 18 | - print $response->statusCode() . "\n"; |
|
| 18 | + print $response->statusCode()."\n"; |
|
| 19 | 19 | print_r($response->headers()); |
| 20 | - print $response->body() . "\n"; |
|
| 20 | + print $response->body()."\n"; |
|
| 21 | 21 | } catch (Exception $e) { |
| 22 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 22 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 23 | 23 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | try { |
| 28 | 28 | $response = $sg->client->whitelabel()->domains()->post($request_body); |
| 29 | - print $response->statusCode() . "\n"; |
|
| 29 | + print $response->statusCode()."\n"; |
|
| 30 | 30 | print_r($response->headers()); |
| 31 | - print $response->body() . "\n"; |
|
| 31 | + print $response->body()."\n"; |
|
| 32 | 32 | } catch (Exception $e) { |
| 33 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 33 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | //////////////////////////////////////////////////// |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | try { |
| 43 | 43 | $response = $sg->client->whitelabel()->domains()->get(null, $query_params); |
| 44 | - print $response->statusCode() . "\n"; |
|
| 44 | + print $response->statusCode()."\n"; |
|
| 45 | 45 | print_r($response->headers()); |
| 46 | - print $response->body() . "\n"; |
|
| 46 | + print $response->body()."\n"; |
|
| 47 | 47 | } catch (Exception $e) { |
| 48 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 48 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | //////////////////////////////////////////////////// |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | try { |
| 56 | 56 | $response = $sg->client->whitelabel()->domains()->default()->get(); |
| 57 | - print $response->statusCode() . "\n"; |
|
| 57 | + print $response->statusCode()."\n"; |
|
| 58 | 58 | print_r($response->headers()); |
| 59 | - print $response->body() . "\n"; |
|
| 59 | + print $response->body()."\n"; |
|
| 60 | 60 | } catch (Exception $e) { |
| 61 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 61 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | //////////////////////////////////////////////////// |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | try { |
| 69 | 69 | $response = $sg->client->whitelabel()->domains()->subuser()->get(); |
| 70 | - print $response->statusCode() . "\n"; |
|
| 70 | + print $response->statusCode()."\n"; |
|
| 71 | 71 | print_r($response->headers()); |
| 72 | - print $response->body() . "\n"; |
|
| 72 | + print $response->body()."\n"; |
|
| 73 | 73 | } catch (Exception $e) { |
| 74 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 74 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | //////////////////////////////////////////////////// |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | try { |
| 82 | 82 | $response = $sg->client->whitelabel()->domains()->subuser()->delete(); |
| 83 | - print $response->statusCode() . "\n"; |
|
| 83 | + print $response->statusCode()."\n"; |
|
| 84 | 84 | print_r($response->headers()); |
| 85 | - print $response->body() . "\n"; |
|
| 85 | + print $response->body()."\n"; |
|
| 86 | 86 | } catch (Exception $e) { |
| 87 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 87 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | //////////////////////////////////////////////////// |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | try { |
| 101 | 101 | $response = $sg->client->whitelabel()->domains()->_($domain_id)->patch($request_body); |
| 102 | - print $response->statusCode() . "\n"; |
|
| 102 | + print $response->statusCode()."\n"; |
|
| 103 | 103 | print_r($response->headers()); |
| 104 | - print $response->body() . "\n"; |
|
| 104 | + print $response->body()."\n"; |
|
| 105 | 105 | } catch (Exception $e) { |
| 106 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 106 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | //////////////////////////////////////////////////// |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | try { |
| 116 | 116 | $response = $sg->client->whitelabel()->domains()->_($domain_id)->get(); |
| 117 | - print $response->statusCode() . "\n"; |
|
| 117 | + print $response->statusCode()."\n"; |
|
| 118 | 118 | print_r($response->headers()); |
| 119 | - print $response->body() . "\n"; |
|
| 119 | + print $response->body()."\n"; |
|
| 120 | 120 | } catch (Exception $e) { |
| 121 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 121 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | //////////////////////////////////////////////////// |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | try { |
| 131 | 131 | $response = $sg->client->whitelabel()->domains()->_($domain_id)->delete(); |
| 132 | - print $response->statusCode() . "\n"; |
|
| 132 | + print $response->statusCode()."\n"; |
|
| 133 | 133 | print_r($response->headers()); |
| 134 | - print $response->body() . "\n"; |
|
| 134 | + print $response->body()."\n"; |
|
| 135 | 135 | } catch (Exception $e) { |
| 136 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 136 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | //////////////////////////////////////////////////// |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | try { |
| 149 | 149 | $response = $sg->client->whitelabel()->domains()->_($domain_id)->subuser()->post($request_body); |
| 150 | - print $response->statusCode() . "\n"; |
|
| 150 | + print $response->statusCode()."\n"; |
|
| 151 | 151 | print_r($response->headers()); |
| 152 | - print $response->body() . "\n"; |
|
| 152 | + print $response->body()."\n"; |
|
| 153 | 153 | } catch (Exception $e) { |
| 154 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 154 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | //////////////////////////////////////////////////// |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | try { |
| 167 | 167 | $response = $sg->client->whitelabel()->domains()->_($id)->ips()->post($request_body); |
| 168 | - print $response->statusCode() . "\n"; |
|
| 168 | + print $response->statusCode()."\n"; |
|
| 169 | 169 | print_r($response->headers()); |
| 170 | - print $response->body() . "\n"; |
|
| 170 | + print $response->body()."\n"; |
|
| 171 | 171 | } catch (Exception $e) { |
| 172 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 172 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | //////////////////////////////////////////////////// |
@@ -181,11 +181,11 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | try { |
| 183 | 183 | $response = $sg->client->whitelabel()->domains()->_($id)->ips()->_($ip)->delete(); |
| 184 | - print $response->statusCode() . "\n"; |
|
| 184 | + print $response->statusCode()."\n"; |
|
| 185 | 185 | print_r($response->headers()); |
| 186 | - print $response->body() . "\n"; |
|
| 186 | + print $response->body()."\n"; |
|
| 187 | 187 | } catch (Exception $e) { |
| 188 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 188 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | //////////////////////////////////////////////////// |
@@ -196,11 +196,11 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | try { |
| 198 | 198 | $response = $sg->client->whitelabel()->domains()->_($id)->validate()->post(); |
| 199 | - print $response->statusCode() . "\n"; |
|
| 199 | + print $response->statusCode()."\n"; |
|
| 200 | 200 | print_r($response->headers()); |
| 201 | - print $response->body() . "\n"; |
|
| 201 | + print $response->body()."\n"; |
|
| 202 | 202 | } catch (Exception $e) { |
| 203 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 203 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | //////////////////////////////////////////////////// |
@@ -215,11 +215,11 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | try { |
| 217 | 217 | $response = $sg->client->whitelabel()->ips()->post($request_body); |
| 218 | - print $response->statusCode() . "\n"; |
|
| 218 | + print $response->statusCode()."\n"; |
|
| 219 | 219 | print_r($response->headers()); |
| 220 | - print $response->body() . "\n"; |
|
| 220 | + print $response->body()."\n"; |
|
| 221 | 221 | } catch (Exception $e) { |
| 222 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 222 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | //////////////////////////////////////////////////// |
@@ -230,11 +230,11 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | try { |
| 232 | 232 | $response = $sg->client->whitelabel()->ips()->get(null, $query_params); |
| 233 | - print $response->statusCode() . "\n"; |
|
| 233 | + print $response->statusCode()."\n"; |
|
| 234 | 234 | print_r($response->headers()); |
| 235 | - print $response->body() . "\n"; |
|
| 235 | + print $response->body()."\n"; |
|
| 236 | 236 | } catch (Exception $e) { |
| 237 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 237 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | //////////////////////////////////////////////////// |
@@ -245,11 +245,11 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | try { |
| 247 | 247 | $response = $sg->client->whitelabel()->ips()->_($id)->get(); |
| 248 | - print $response->statusCode() . "\n"; |
|
| 248 | + print $response->statusCode()."\n"; |
|
| 249 | 249 | print_r($response->headers()); |
| 250 | - print $response->body() . "\n"; |
|
| 250 | + print $response->body()."\n"; |
|
| 251 | 251 | } catch (Exception $e) { |
| 252 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 252 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | //////////////////////////////////////////////////// |
@@ -260,11 +260,11 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | try { |
| 262 | 262 | $response = $sg->client->whitelabel()->ips()->_($id)->delete(); |
| 263 | - print $response->statusCode() . "\n"; |
|
| 263 | + print $response->statusCode()."\n"; |
|
| 264 | 264 | print_r($response->headers()); |
| 265 | - print $response->body() . "\n"; |
|
| 265 | + print $response->body()."\n"; |
|
| 266 | 266 | } catch (Exception $e) { |
| 267 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 267 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | //////////////////////////////////////////////////// |
@@ -275,11 +275,11 @@ discard block |
||
| 275 | 275 | |
| 276 | 276 | try { |
| 277 | 277 | $response = $sg->client->whitelabel()->ips()->_($id)->validate()->post(); |
| 278 | - print $response->statusCode() . "\n"; |
|
| 278 | + print $response->statusCode()."\n"; |
|
| 279 | 279 | print_r($response->headers()); |
| 280 | - print $response->body() . "\n"; |
|
| 280 | + print $response->body()."\n"; |
|
| 281 | 281 | } catch (Exception $e) { |
| 282 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 282 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | //////////////////////////////////////////////////// |
@@ -295,11 +295,11 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | try { |
| 297 | 297 | $response = $sg->client->whitelabel()->links()->post($request_body, $query_params); |
| 298 | - print $response->statusCode() . "\n"; |
|
| 298 | + print $response->statusCode()."\n"; |
|
| 299 | 299 | print_r($response->headers()); |
| 300 | - print $response->body() . "\n"; |
|
| 300 | + print $response->body()."\n"; |
|
| 301 | 301 | } catch (Exception $e) { |
| 302 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 302 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | //////////////////////////////////////////////////// |
@@ -310,11 +310,11 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | try { |
| 312 | 312 | $response = $sg->client->whitelabel()->links()->get(null, $query_params); |
| 313 | - print $response->statusCode() . "\n"; |
|
| 313 | + print $response->statusCode()."\n"; |
|
| 314 | 314 | print_r($response->headers()); |
| 315 | - print $response->body() . "\n"; |
|
| 315 | + print $response->body()."\n"; |
|
| 316 | 316 | } catch (Exception $e) { |
| 317 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 317 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | //////////////////////////////////////////////////// |
@@ -325,11 +325,11 @@ discard block |
||
| 325 | 325 | |
| 326 | 326 | try { |
| 327 | 327 | $response = $sg->client->whitelabel()->links()->default()->get(null, $query_params); |
| 328 | - print $response->statusCode() . "\n"; |
|
| 328 | + print $response->statusCode()."\n"; |
|
| 329 | 329 | print_r($response->headers()); |
| 330 | - print $response->body() . "\n"; |
|
| 330 | + print $response->body()."\n"; |
|
| 331 | 331 | } catch (Exception $e) { |
| 332 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 332 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | //////////////////////////////////////////////////// |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | try { |
| 342 | 342 | $response = $sg->client->whitelabel()->links()->subuser()->get(null, $query_params); |
| 343 | - print $response->statusCode() . "\n"; |
|
| 343 | + print $response->statusCode()."\n"; |
|
| 344 | 344 | print_r($response->headers()); |
| 345 | - print $response->body() . "\n"; |
|
| 345 | + print $response->body()."\n"; |
|
| 346 | 346 | } catch (Exception $e) { |
| 347 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 347 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | //////////////////////////////////////////////////// |
@@ -355,11 +355,11 @@ discard block |
||
| 355 | 355 | |
| 356 | 356 | try { |
| 357 | 357 | $response = $sg->client->whitelabel()->links()->subuser()->delete(null, $query_params); |
| 358 | - print $response->statusCode() . "\n"; |
|
| 358 | + print $response->statusCode()."\n"; |
|
| 359 | 359 | print_r($response->headers()); |
| 360 | - print $response->body() . "\n"; |
|
| 360 | + print $response->body()."\n"; |
|
| 361 | 361 | } catch (Exception $e) { |
| 362 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 362 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | //////////////////////////////////////////////////// |
@@ -373,11 +373,11 @@ discard block |
||
| 373 | 373 | |
| 374 | 374 | try { |
| 375 | 375 | $response = $sg->client->whitelabel()->links()->_($id)->patch($request_body); |
| 376 | - print $response->statusCode() . "\n"; |
|
| 376 | + print $response->statusCode()."\n"; |
|
| 377 | 377 | print_r($response->headers()); |
| 378 | - print $response->body() . "\n"; |
|
| 378 | + print $response->body()."\n"; |
|
| 379 | 379 | } catch (Exception $e) { |
| 380 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 380 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | //////////////////////////////////////////////////// |
@@ -388,11 +388,11 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | try { |
| 390 | 390 | $response = $sg->client->whitelabel()->links()->_($id)->get(); |
| 391 | - print $response->statusCode() . "\n"; |
|
| 391 | + print $response->statusCode()."\n"; |
|
| 392 | 392 | print_r($response->headers()); |
| 393 | - print $response->body() . "\n"; |
|
| 393 | + print $response->body()."\n"; |
|
| 394 | 394 | } catch (Exception $e) { |
| 395 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 395 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | //////////////////////////////////////////////////// |
@@ -403,11 +403,11 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | try { |
| 405 | 405 | $response = $sg->client->whitelabel()->links()->_($id)->delete(); |
| 406 | - print $response->statusCode() . "\n"; |
|
| 406 | + print $response->statusCode()."\n"; |
|
| 407 | 407 | print_r($response->headers()); |
| 408 | - print $response->body() . "\n"; |
|
| 408 | + print $response->body()."\n"; |
|
| 409 | 409 | } catch (Exception $e) { |
| 410 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 410 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | //////////////////////////////////////////////////// |
@@ -418,11 +418,11 @@ discard block |
||
| 418 | 418 | |
| 419 | 419 | try { |
| 420 | 420 | $response = $sg->client->whitelabel()->links()->_($id)->validate()->post(); |
| 421 | - print $response->statusCode() . "\n"; |
|
| 421 | + print $response->statusCode()."\n"; |
|
| 422 | 422 | print_r($response->headers()); |
| 423 | - print $response->body() . "\n"; |
|
| 423 | + print $response->body()."\n"; |
|
| 424 | 424 | } catch (Exception $e) { |
| 425 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 425 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | //////////////////////////////////////////////////// |
@@ -436,9 +436,9 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | try { |
| 438 | 438 | $response = $sg->client->whitelabel()->links()->_($link_id)->subuser()->post($request_body); |
| 439 | - print $response->statusCode() . "\n"; |
|
| 439 | + print $response->statusCode()."\n"; |
|
| 440 | 440 | print_r($response->headers()); |
| 441 | - print $response->body() . "\n"; |
|
| 441 | + print $response->body()."\n"; |
|
| 442 | 442 | } catch (Exception $e) { |
| 443 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 443 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 444 | 444 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | try { |
| 17 | 17 | $response = $sg->client->categories()->get(null, $query_params); |
| 18 | - print $response->statusCode() . "\n"; |
|
| 18 | + print $response->statusCode()."\n"; |
|
| 19 | 19 | print_r($response->headers()); |
| 20 | - print $response->body() . "\n"; |
|
| 20 | + print $response->body()."\n"; |
|
| 21 | 21 | } catch (Exception $e) { |
| 22 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 22 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | //////////////////////////////////////////////////// |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | try { |
| 32 | 32 | $response = $sg->client->categories()->stats()->get(null, $query_params); |
| 33 | - print $response->statusCode() . "\n"; |
|
| 33 | + print $response->statusCode()."\n"; |
|
| 34 | 34 | print_r($response->headers()); |
| 35 | - print $response->body() . "\n"; |
|
| 35 | + print $response->body()."\n"; |
|
| 36 | 36 | } catch (Exception $e) { |
| 37 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 37 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | //////////////////////////////////////////////////// |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | try { |
| 47 | 47 | $response = $sg->client->categories()->stats()->sums()->get(null, $query_params); |
| 48 | - print $response->statusCode() . "\n"; |
|
| 48 | + print $response->statusCode()."\n"; |
|
| 49 | 49 | print_r($response->headers()); |
| 50 | - print $response->body() . "\n"; |
|
| 50 | + print $response->body()."\n"; |
|
| 51 | 51 | } catch (Exception $e) { |
| 52 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 52 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 53 | 53 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | // Next line will load dependencies to run this example |
| 4 | 4 | // Please refer to the README how to use in your project |
| 5 | -require_once __DIR__ . '/../../sendgrid-php.php'; |
|
| 5 | +require_once __DIR__.'/../../sendgrid-php.php'; |
|
| 6 | 6 | |
| 7 | 7 | $apiKey = getenv('SENDGRID_API_KEY'); |
| 8 | 8 | $sg = new \SendGrid($apiKey); |
@@ -13,11 +13,11 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | try { |
| 15 | 15 | $response = $sg->client->mail()->batch()->post(); |
| 16 | - print $response->statusCode() . "\n"; |
|
| 16 | + print $response->statusCode()."\n"; |
|
| 17 | 17 | print_r($response->headers()); |
| 18 | - print $response->body() . "\n"; |
|
| 18 | + print $response->body()."\n"; |
|
| 19 | 19 | } catch (Exception $e) { |
| 20 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 20 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | //////////////////////////////////////////////////// |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | try { |
| 30 | 30 | $response = $sg->client->mail()->batch()->_($batch_id)->get(); |
| 31 | - print $response->statusCode() . "\n"; |
|
| 31 | + print $response->statusCode()."\n"; |
|
| 32 | 32 | print_r($response->headers()); |
| 33 | - print $response->body() . "\n"; |
|
| 33 | + print $response->body()."\n"; |
|
| 34 | 34 | } catch (Exception $e) { |
| 35 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 35 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | //////////////////////////////////////////////////// |
@@ -190,9 +190,9 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | try { |
| 192 | 192 | $response = $sg->client->mail()->send()->post($request_body); |
| 193 | - print $response->statusCode() . "\n"; |
|
| 193 | + print $response->statusCode()."\n"; |
|
| 194 | 194 | print_r($response->headers()); |
| 195 | - print $response->body() . "\n"; |
|
| 195 | + print $response->body()."\n"; |
|
| 196 | 196 | } catch (Exception $e) { |
| 197 | - echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 197 | + echo 'Caught exception: ', $e->getMessage(), "\n"; |
|
| 198 | 198 | } |