|
3 | 3 | require_once (dirname(__FILE__).'/../bootstrap.php'); |
4 | 4 |
|
5 | 5 | //pull in API key config |
6 | | -$configFile = file_get_contents(dirname(__FILE__) . "/../example-config.json"); |
| 6 | +$configFile = file_get_contents(dirname(__FILE__) . '/../example-config.json'); |
7 | 7 | $config = json_decode($configFile, true); |
8 | 8 |
|
9 | 9 | use SparkPost\SparkPost; |
|
15 | 15 |
|
16 | 16 | try{ |
17 | 17 | $results = $sparky->transmission->send([ |
18 | | - "campaign"=>"my-campaign", |
19 | | - "metadata"=>[ |
20 | | - "sample_campaign"=>true, |
21 | | - "type"=>"these are custom fields" |
22 | | - ], |
23 | | - "substitutionData"=>[ |
24 | | - "name"=>"Test Name" |
25 | | - ], |
26 | | - "description"=>"my description", |
27 | | - "replyTo"=>"reply@test.com", |
28 | | - "customHeaders"=>[ |
29 | | - "X-Custom-Header"=>"Sample Custom Header" |
30 | | - ], |
31 | | - "trackOpens"=>false, |
32 | | - "trackClicks"=>false, |
33 | | - "from"=>"From Envelope <from@sparkpostbox.com>", |
34 | | - "html"=>"<p>Hello World! Your name is: {{name}}</p>", |
35 | | - "text"=>"Hello World!", |
36 | | - "subject"=>"Example Email: {{name}}", |
37 | | - "recipients"=>[ |
38 | | - [ |
39 | | - "address"=>[ |
40 | | - "email"=>"john.doe@example.com" |
| 18 | + 'campaign'=>'my-campaign', |
| 19 | + 'metadata'=>[ |
| 20 | + 'sample_campaign'=>true, |
| 21 | + 'type'=>'these are custom fields' |
| 22 | + ], |
| 23 | + 'substitutionData'=>[ |
| 24 | + 'name'=>'Test Name' |
| 25 | + ], |
| 26 | + 'description'=>'my description', |
| 27 | + 'replyTo'=>'reply@test.com', |
| 28 | + 'customHeaders'=>[ |
| 29 | + 'X-Custom-Header'=>'Sample Custom Header' |
| 30 | + ], |
| 31 | + 'trackOpens'=>false, |
| 32 | + 'trackClicks'=>false, |
| 33 | + 'from'=>'From Envelope <from@sparkpostbox.com>', |
| 34 | + 'html'=>'<p>Hello World! Your name is: {{name}}</p>', |
| 35 | + 'text'=>'Hello World!', |
| 36 | + 'subject'=>'Example Email: {{name}}', |
| 37 | + 'recipients'=>[ |
| 38 | + [ |
| 39 | + 'address'=>[ |
| 40 | + 'email'=>'john.doe@example.com' |
41 | 41 | ] |
42 | | - ] |
43 | | - ] |
44 | | - ]); |
| 42 | + ] |
| 43 | + ] |
| 44 | + ]); |
45 | 45 |
|
46 | | - echo 'Congrats you can use your SDK!'; |
| 46 | + echo 'Congrats you can use your SDK!'; |
47 | 47 | } catch (\Exception $exception) { |
48 | | - echo $exception->getMessage(); |
| 48 | + echo $exception->getMessage(); |
49 | 49 | } |
50 | 50 | ?> |
0 commit comments