-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated and tested all examples. README updated.
Update transmissions GET & DELETE deprecations
- Loading branch information
tuck1s
committed
Mar 16, 2021
1 parent
eeb6ba9
commit 6171690
Showing
20 changed files
with
164 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,18 @@ | |
|
||
$httpClient = new GuzzleAdapter(new Client()); | ||
|
||
$sparky = new SparkPost($httpClient, ["key" => "YOUR_API_KEY"]); | ||
// In these examples, fetch API key from environment variable | ||
$sparky = new SparkPost($httpClient, ["key" => getenv('SPARKPOST_API_KEY')]); | ||
|
||
// put your own sending domain and test recipient address here | ||
$sending_domain = "steve2-test.trymsys.net"; | ||
$your_email = "[email protected]"; | ||
|
||
$promise = $sparky->transmissions->post([ | ||
'content' => [ | ||
'from' => [ | ||
'name' => 'SparkPost Team', | ||
'email' => 'from@sparkpostbox.com', | ||
'email' => "from@$sending_domain", | ||
], | ||
'subject' => 'First Mailing From PHP', | ||
'html' => '<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent your very first mailing!</p></body></html>', | ||
|
@@ -27,7 +32,7 @@ | |
[ | ||
'address' => [ | ||
'name' => 'YOUR_NAME', | ||
'email' => 'YOUR_EMAIL', | ||
'email' => $your_email, | ||
], | ||
], | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,18 +10,23 @@ | |
|
||
$httpClient = new GuzzleAdapter(new Client()); | ||
|
||
$sparky = new SparkPost($httpClient, ["key" => "YOUR_API_KEY"]); | ||
// In these examples, fetch API key from environment variable | ||
$sparky = new SparkPost($httpClient, ["key" => getenv('SPARKPOST_API_KEY')]); | ||
|
||
$filePath = dirname(__FILE__).'/'; | ||
$fileName = 'sparkpost.png'; | ||
$fileType = mime_content_type($filePath.$fileName); | ||
$fileData = base64_encode(file_get_contents($filePath.$fileName)); | ||
|
||
// put your own sending domain and test recipient address here | ||
$sending_domain = "steve2-test.trymsys.net"; | ||
$your_email = "[email protected]"; | ||
|
||
$promise = $sparky->transmissions->post([ | ||
'content' => [ | ||
'from' => [ | ||
'name' => 'SparkPost Team', | ||
'email' => 'from@sparkpostbox.com', | ||
'email' => "from@$sending_domain", | ||
], | ||
'subject' => 'Mailing With Attachment From PHP', | ||
'html' => '<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent an email with an attachment!</p></body></html>', | ||
|
@@ -39,7 +44,7 @@ | |
[ | ||
'address' => [ | ||
'name' => 'YOUR_NAME', | ||
'email' => 'YOUR_EMAIL', | ||
'email' => $your_email, | ||
], | ||
], | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,20 @@ | |
|
||
$httpClient = new GuzzleAdapter(new Client()); | ||
|
||
$sparky = new SparkPost($httpClient, ["key" => "YOUR_API_KEY"]); | ||
// In these examples, fetch API key from environment variable | ||
$sparky = new SparkPost($httpClient, ["key" => getenv('SPARKPOST_API_KEY')]); | ||
|
||
// put your own sending domain and test recipient address here | ||
$sending_domain = "steve2-test.trymsys.net"; | ||
$your_email = "[email protected]"; | ||
$your_cc = "[email protected]"; | ||
$your_bcc = "[email protected]"; | ||
|
||
$promise = $sparky->transmissions->post([ | ||
'content' => [ | ||
'from' => [ | ||
'name' => 'SparkPost Team', | ||
'email' => 'from@sparkpostbox.com', | ||
'email' => "from@$sending_domain", | ||
], | ||
'subject' => 'Mailing With CC and BCC From PHP', | ||
'html' => '<html><body><h1>Congratulations, {{name}}!</h1><p>You just sent your very first mailing with CC and BCC recipients!</p></body></html>', | ||
|
@@ -27,23 +34,23 @@ | |
[ | ||
'address' => [ | ||
'name' => 'YOUR_NAME', | ||
'email' => 'YOUR_EMAIL', | ||
'email' => $your_email, | ||
], | ||
], | ||
], | ||
'cc' => [ | ||
[ | ||
'address' => [ | ||
'name' => 'ANOTHER_NAME', | ||
'email' => 'ANOTHER_EMAIL', | ||
'email' => $your_cc, | ||
], | ||
], | ||
], | ||
'bcc' => [ | ||
[ | ||
'address' => [ | ||
'name' => 'AND_ANOTHER_NAME', | ||
'email' => 'AND_ANOTHER_EMAIL', | ||
'email' => $your_bcc, | ||
], | ||
], | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.