Skip to content

Commit 9952687

Browse files
authored
Revert "updating Mailjet code samples for Send API v3.1 (GoogleCloudPlatform#432)" (GoogleCloudPlatform#441)
This reverts commit d2911c6.
1 parent d2911c6 commit 9952687

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

appengine/flexible/mailjet/app.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,31 @@
4040
/** @var Mailjet\Client $mailjet */
4141
$mailjet = $app['mailjet'];
4242
$recipient = $request->get('recipient');
43+
4344
# [START send_email]
4445
$body = [
45-
'Messages' => [
46+
'FromEmail' => "[email protected]",
47+
'FromName' => "Testing Mailjet",
48+
'Subject' => "Your email flight plan!",
49+
'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
50+
'Html-part' => "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!
"
,
51+
'Recipients' => [
4652
[
47-
'From' => [
48-
'Email' => "[email protected]",
49-
'Name' => "Mailjet Pilot"
50-
],
51-
'To' => [
52-
[
53-
'Email' => $recipient
54-
]
55-
],
56-
'Subject' => "Your email flight plan!",
57-
'TextPart' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
58-
'HTMLPart' => "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!
"
53+
'Email' => $recipient,
5954
]
6055
]
6156
];
57+
6258
// trigger the API call
63-
$response = $mailjet->post(Mailjet\Resources::$Email, ['body' => $body], ['version' => 'v3.1']);
59+
$response = $mailjet->post(Mailjet\Resources::$Email, ['body' => $body]);
6460
if ($response->success()) {
6561
// if the call succed, data will go here
6662
return sprintf(
6763
'
%s
'
,
6864
json_encode($response->getData(), JSON_PRETTY_PRINT)
6965
);
7066
}
67+
7168
return 'Error: ' . print_r($response->getStatus(), true);
7269
# [END send_email]
7370
});

appengine/flexible/mailjet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"silex/silex": "^1.3",
4-
"mailjet/mailjet-apiv3-php": "^1.2",
4+
"mailjet/mailjet-apiv3-php": "^1.1",
55
"guzzlehttp/guzzle": "~6.1.0"
66
},
77
"require-dev": {

appengine/standard/mailjet/app.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,31 @@
4040
/** @var Mailjet\Client $mailjet */
4141
$mailjet = $app['mailjet'];
4242
$recipient = $request->get('recipient');
43+
4344
# [START send_email]
4445
$body = [
45-
'Messages' => [
46+
'FromEmail' => "[email protected]",
47+
'FromName' => "Testing Mailjet",
48+
'Subject' => "Your email flight plan!",
49+
'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
50+
'Html-part' => "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!
"
,
51+
'Recipients' => [
4652
[
47-
'From' => [
48-
'Email' => "[email protected]",
49-
'Name' => "Mailjet Pilot"
50-
],
51-
'To' => [
52-
[
53-
'Email' => $recipient
54-
]
55-
],
56-
'Subject' => "Your email flight plan!",
57-
'TextPart' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!",
58-
'HTMLPart' => "

Dear passenger, welcome to Mailjet!


May the delivery force be with you!
"
53+
'Email' => $recipient,
5954
]
6055
]
6156
];
57+
6258
// trigger the API call
63-
$response = $mailjet->post(Mailjet\Resources::$Email, ['body' => $body], ['version' => 'v3.1']);
59+
$response = $mailjet->post(Mailjet\Resources::$Email, ['body' => $body]);
6460
if ($response->success()) {
6561
// if the call succed, data will go here
6662
return sprintf(
6763
'
%s
'
,
6864
json_encode($response->getData(), JSON_PRETTY_PRINT)
6965
);
7066
}
67+
7168
return 'Error: ' . print_r($response->getStatus(), true);
7269
# [END send_email]
7370
});

appengine/standard/mailjet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"silex/silex": "^1.3",
4-
"mailjet/mailjet-apiv3-php": "^1.2",
4+
"mailjet/mailjet-apiv3-php": "^1.1",
55
"guzzlehttp/guzzle": "~6.1.0"
66
},
77
"require-dev": {

0 commit comments

Comments
 (0)