Skip to content

Commit 756f79e

Browse files
correct quotes in json
1 parent 3625604 commit 756f79e

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

lib/Model/CreateAttribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public function getEnumeration()
284284
/**
285285
* Sets enumeration
286286
*
287-
* @param \SendinBlue\Client\Model\CreateAttributeEnumeration[] $enumeration List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{'value':1, 'label':'male'}, {'value':2, 'label':'female'}]
287+
* @param \SendinBlue\Client\Model\CreateAttributeEnumeration[] $enumeration List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, `[{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]`
288288
*
289289
* @return $this
290290
*/

lib/Model/CreateContact.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function getEmail()
253253
/**
254254
* Sets email
255255
*
256-
* @param string $email Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {'SMS':'+91xxxxxxxxxx'} or {'SMS':'0091xxxxxxxxxx'}
256+
* @param string $email Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}
257257
*
258258
* @return $this
259259
*/
@@ -277,7 +277,7 @@ public function getAttributes()
277277
/**
278278
* Sets attributes
279279
*
280-
* @param object $attributes Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'}
280+
* @param object $attributes Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. `{\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}`
281281
*
282282
* @return $this
283283
*/

lib/Model/CreateEmailCampaign.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ public function getParams()
840840
/**
841841
* Sets params
842842
*
843-
* @param object $params Pass the set of attributes to customize the type classic campaign. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField'
843+
* @param object $params Pass the set of attributes to customize the type classic campaign. For example, `{\"FNAME\":\"Joe\", \"LNAME:\"Doe\"}`. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField'
844844
*
845845
* @return $this
846846
*/

self_script.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
require_once(__DIR__ . '/vendor/autoload.php');
3+
4+
// Configure API key authorization: api-key
5+
$config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('api-key', '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');
6+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
7+
// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('api-key', 'Bearer');
8+
// Configure API key authorization: partner-key
9+
// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKey('partner-key', 'YOUR_API_KEY');
10+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
11+
// $config = SendinBlue\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('partner-key', 'Bearer');
12+
13+
$apiInstance = new SendinBlue\Client\Api\EmailCampaignsApi(
14+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
15+
// This is optional, `GuzzleHttp\Client` will be used as default.
16+
new GuzzleHttp\Client(),
17+
$config
18+
);
19+
$emailCampaigns = new \SendinBlue\Client\Model\CreateEmailCampaign(); // \SendinBlue\Client\Model\CreateEmailCampaign | Values to create a campaign
20+
21+
22+
23+
24+
$emailCampaigns["name"] = "dasda";
25+
$emailCampaigns["subject"] = "SIB php wrap TestSubject {{params.subject}}";
26+
$emailCampaigns["sender"] = array("name"=> "Shubham Upadhyay", "email"=>"[email protected]");
27+
$emailCampaigns["type"] = "classic";
28+
29+
30+
$emailCampaigns["1htmlContent"] = " dgdg gdhjas dakhd ";
31+
32+
33+
$emailCampaigns["recipients"] = array("listIds"=>[291]);
34+
35+
36+
$emailCampaigns["scheduledAt"] = "2019-09-04 00:00:01";
37+
$emailCampaigns["templateId"] = 750;
38+
$emailCampaigns["params"] = array("subject"=>"xyz" , "email"=>"[email protected]", "value"=> array("test"=>"test"), "NAME"=>"QWERTY");
39+
40+
41+
try {
42+
$result = $apiInstance->createEmailCampaign($emailCampaigns);
43+
print_r($result);
44+
} catch (Exception $e) {
45+
echo 'Exception when calling EmailCampaignsApi->createEmailCampaign: ', $e->getMessage(), PHP_EOL;
46+
}
47+
48+
exit;
49+
?>

0 commit comments

Comments
 (0)