File tree Expand file tree Collapse file tree 10 files changed +47
-47
lines changed Expand file tree Collapse file tree 10 files changed +47
-47
lines changed Original file line number Diff line number Diff line change 1414$ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
1515
1616try {
17- $ results = $ sparky ->transmission ->delete ('transmission-id ' );
18- echo 'Transmission deleted! ' ;
17+ $ results = $ sparky ->transmission ->delete ('transmission-id ' );
18+ echo 'Transmission deleted! ' ;
1919} catch (\Exception $ exception ) {
20- echo $ exception ->getMessage ();
20+ echo $ exception ->getMessage ();
2121}
2222?>
Original file line number Diff line number Diff line change 1414$ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
1515
1616try {
17- $ results = $ sparky ->transmission ->all ();
18- echo 'Congrats you can use your SDK ! ' ;
17+ $ results = $ sparky ->transmission ->all ();
18+ echo 'Congrats! You got a list of all your transmissions from SparkPost ! ' ;
1919} catch (\Exception $ exception ) {
20- echo $ exception ->getMessage ();
20+ echo $ exception ->getMessage ();
2121}
2222?>
Original file line number Diff line number Diff line change 1414$ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
1515
1616try {
17- $ results = $ sparky ->transmission ->find ('Your Transmission ID ' );
18- echo 'Congrats you can use your SDK ! ' ;
17+ $ results = $ sparky ->transmission ->find ('Your Transmission ID ' );
18+ echo 'Congrats! You retrieved your transmission from SparkPost ! ' ;
1919} catch (\Exception $ exception ) {
20- echo $ exception ->getMessage ();
20+ echo $ exception ->getMessage ();
2121}
2222?>
Original file line number Diff line number Diff line change 1414$ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
1515
1616try {
17- $ results = $ sparky ->transmission ->send ([
18- 'recipients ' =>[
19- [
20- 'address ' =>[
21- 'email ' =>'john.doe@example.com '
22- ]
23- ]
24- ],
25- 'rfc822 ' =>'Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World '
26- ]);
27- echo 'Congrats you can use your SDK ! ' ;
17+ $ results = $ sparky ->transmission ->send ([
18+ 'recipients ' =>[
19+ [
20+ 'address ' =>[
21+ 'email ' =>'john.doe@example.com '
22+ ]
23+ ]
24+ ],
25+ 'rfc822 ' =>'Content-Type: text/plain\nFrom: From Envelope <from@sparkpostbox.com>\nSubject: Example Email\n\nHello World '
26+ ]);
27+ echo 'Congrats! You sent an email using SparkPost ! ' ;
2828} catch (\Exception $ exception ) {
29- echo $ exception ->getMessage ();
29+ echo $ exception ->getMessage ();
3030}
3131?>
Original file line number Diff line number Diff line change 3838 'startTime ' =>'2016-03-17T08:00:00-04:00 ' ,
3939 'from ' =>[
4040 'name ' => 'From Envelope ' ,
41- 'email ' => 'from@sparkpostbox.com> '
41+ 'email ' => 'from@sparkpostbox.com '
4242 ],
4343 'html ' =>'<p>Hello World! Your name is: {{name}}</p> ' ,
4444 'text ' =>'Hello World! ' ,
5959 ]
6060 ]);
6161
62- echo 'Congrats you can use your SDK ! ' ;
62+ echo 'Congrats! You sent an email using SparkPost ! ' ;
6363} catch (\Exception $ exception ) {
6464 echo $ exception ->getMessage ();
6565}
Original file line number Diff line number Diff line change 1717 $ results = $ sparky ->transmission ->send ([
1818 'from ' =>[
1919 'name ' => 'From Envelope ' ,
20- 'email ' => 'from@sparkpostbox.com> '
20+ 'email ' => 'from@sparkpostbox.com '
2121 ],
2222 'html ' =>'<p>Hello World!</p> ' ,
2323 'text ' =>'Hello World! ' ,
3030 ]
3131 ]
3232 ]);
33- echo 'Congrats you can use your SDK ! ' ;
33+ echo 'Congrats! You sent an email using SparkPost ! ' ;
3434} catch (\Exception $ exception ) {
3535 echo $ exception ->getMessage ();
3636}
Original file line number Diff line number Diff line change 1919 'campaign ' =>'my-campaign ' ,
2020 'from ' =>[
2121 'name ' => 'From Envelope ' ,
22- 'email ' => 'from@sparkpostbox.com> '
22+ 'email ' => 'from@sparkpostbox.com '
2323 ],
2424 'html ' =>'<p>Hello World! Your name is: {{name}}</p> ' ,
2525 'text ' =>'Hello World! ' ,
2626 'subject ' =>'Example Email: {{name}} ' ,
2727 'recipientList ' =>'Example List '
2828 ]);
2929
30- echo 'Congrats you can use your SDK ! ' ;
30+ echo 'Congrats! You sent an email using SparkPost ! ' ;
3131} catch (\Exception $ exception ) {
3232 echo $ exception ->getMessage ();
3333}
Original file line number Diff line number Diff line change 1717 $ results = $ sparky ->transmission ->send ([
1818 'from ' =>[
1919 'name ' => 'From Envelope ' ,
20- 'email ' => 'from@sparkpostbox.com> '
20+ 'email ' => 'from@sparkpostbox.com '
2121 ],
2222 'recipients ' =>[
2323 [
2828 ],
2929 'template ' =>'my-first-email '
3030 ]);
31- echo 'Congrats you can use your SDK ! ' ;
31+ echo 'Congrats! You sent an email using SparkPost ! ' ;
3232} catch (\Exception $ exception ) {
3333 echo $ exception ->getMessage ();
3434}
Original file line number Diff line number Diff line change 1414$ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
1515
1616try {
17- // define the endpoint
18- $ sparky ->setupUnwrapped ('templates ' );
17+ // define the endpoint
18+ $ sparky ->setupUnwrapped ('templates ' );
1919
20- $ templateConfig = [
21- 'name ' => 'Summer Sale! ' ,
22- 'id ' =>'summer-sale ' ,
23- 'content ' => [
24- 'from ' => 'from@sparkpostbox.com ' ,
25- 'subject ' => 'Summer deals ' ,
26- 'html ' => '<b>Check out these deals!</b> '
27- ]
28- ];
29- $ results = $ sparky ->templates ->create ($ templateConfig );
30- echo 'Congrats you can use your SDK ! ' ;
20+ $ templateConfig = [
21+ 'name ' => 'Summer Sale! ' ,
22+ 'id ' =>'summer-sale ' ,
23+ 'content ' => [
24+ 'from ' => 'from@sparkpostbox.com ' ,
25+ 'subject ' => 'Summer deals ' ,
26+ 'html ' => '<b>Check out these deals!</b> '
27+ ]
28+ ];
29+ $ results = $ sparky ->templates ->create ($ templateConfig );
30+ echo 'Congrats! You created a template using SparkPost ! ' ;
3131} catch (\Exception $ exception ) {
32- echo $ exception ->getMessage ();
32+ echo $ exception ->getMessage ();
3333}
3434?>
Original file line number Diff line number Diff line change 1414$ sparky = new SparkPost ($ httpAdapter , ['key ' =>$ config ['api-key ' ]]);
1515
1616try {
17- $ sparky ->setupUnwrapped ('webhooks ' );
17+ $ sparky ->setupUnwrapped ('webhooks ' );
1818
19- $ results = $ sparky ->webhooks ->get ();
19+ $ results = $ sparky ->webhooks ->get ();
2020
21- echo 'Congrats you can use your SDK ! ' ;
21+ echo 'Congrats! You got a list of all your webhooks from SparkPost ! ' ;
2222} catch (\Exception $ exception ) {
23- echo $ exception ->getMessage ();
23+ echo $ exception ->getMessage ();
2424}
2525?>
You can’t perform that action at this time.
0 commit comments