$config['api-key']]); $data = file_get_contents('/path/to/test.csv'); try{ $results = $sparky->transmission->send([ 'campaign'=>'my-campaign', 'metadata'=>[ 'sample_campaign'=>true, 'type'=>'these are custom fields' ], 'substitutionData'=>[ 'name'=>'Test Name' ], 'description'=>'my description', 'replyTo'=>'reply@test.com', 'customHeaders'=>[ 'X-Custom-Header'=>'Sample Custom Header' ], 'trackOpens'=>false, 'trackClicks'=>false, 'sandbox'=>false, 'inlineCss'=>true, 'transactional'=>true, 'startTime'=>'2016-03-17T08:00:00-04:00', 'from'=>[ 'name' => 'From Envelope', 'email' => 'from@sparkpostbox.com>' ], 'html'=>'

Hello World! Your name is: {{name}}

', 'text'=>'Hello World!', 'subject'=>'Example Email: {{name}}', 'recipients'=>[ [ 'address'=>[ 'email'=>'john.doe@example.com' ] ] ], 'attachments'=>[ [ 'type'=>'text/csv', 'name'=>'testing.csv', 'data'=>base64_encode($data) ] ] ]); echo 'Congrats you can use your SDK!'; } catch (\Exception $exception) { echo $exception->getMessage(); } ?>