summaryrefslogtreecommitdiffstats
path: root/examples/transmission/stored_template_send.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/transmission/stored_template_send.php')
-rw-r--r--examples/transmission/stored_template_send.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/transmission/stored_template_send.php b/examples/transmission/stored_template_send.php
new file mode 100644
index 0000000..298ba69
--- /dev/null
+++ b/examples/transmission/stored_template_send.php
@@ -0,0 +1,26 @@
+<?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([
+ "from"=>"From Envelope <from@example.com>",
+ "recipients"=>[
+ [
+ "address"=>[
+ "email"=>"john.doe@sample.com"
+ ]
+ ]
+ ],
+ "template"=>"my-template"
+ ]);
+ echo 'Congrats you can use your SDK!';
+} catch (\Exception $exception) {
+ echo $exception->getMessage();
+}
+?> \ No newline at end of file