summaryrefslogtreecommitdiffstats
path: root/examples/transmission/configuration_based.php
blob: 157d3f3651f6eba7eecd7c7aa487f4ce4aae198e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace Examples\Transmisson;	
require_once (dirname(__FILE__).'/../bootstrap.php');

use MessageSystems\SparkPost;
use MessageSystems\Transmission;

$key = 'YOURAPIKEY'; 
SparkPost::setConfig(['key'=>$key]);

try {
	$results = Transmission::send([
		"returnPath"=>"return@example.com",
		"from"=>"From Envelope <from@example.com>",
  		"html"=>"<p>Hello World!</p>",
  		"text"=>"Hello World!",
  		"subject"=>"Example Email",
  		"recipients"=>[
    		[
    			"address"=>[
        			"email"=>"john.doe@example.com"
    			]
      		]
    	]
	]);
	echo 'Congrats you can use your SDK!';
} catch (\Exception $exception) {
	echo $exception->getMessage();
}
?>