Skip to content

Commit

Permalink
Merge pull request #316 from mailjet/DE-1375-php-mailjet-wrapper-mult…
Browse files Browse the repository at this point in the history
…iple-api-v-3-endpoints-not-working-correctly

Project improvements. In Progress
  • Loading branch information
oleksandr-mykhailenko authored Dec 19, 2024
2 parents 5c2717d + d7c4e24 commit 638c0a7
Show file tree
Hide file tree
Showing 10 changed files with 598 additions and 272 deletions.
142 changes: 0 additions & 142 deletions .php_cs

This file was deleted.

75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,81 @@ try {
}
```

### Get Campaigns with filters

```php
require 'vendor/autoload.php';

use \Mailjet\Resources;

$mj = new \Mailjet\Client(
'xxx',
'yyy',
true,
['version' => 'v3']
);
try {
//Note: If no query parameters are used, only campaigns sent since 00:00 UTC on the current day will be returned.
$filters = [
'period' => 'Year',
];
$response = $mj->get(Resources::$Campaign, ['filters' => $filters]);
print_r($response->getBody());

} catch (Throwable $throwable) {
print_r($throwable->getMessage());
}
```

### Get ESP statistics

```php
require 'vendor/autoload.php';

use \Mailjet\Resources;

$mj = new \Mailjet\Client(
'xxxx',
'yyyy',
true,
['version' => 'v3']
);
try {
$filters = [
'CampaignID' => 123456,
];
$response = $mj->get(Resources::$Useragentstatistics, ['filters' => $filters]);
print_r($response->getBody());


} catch (Throwable $throwable) {
print_r($throwable->getMessage());
}
```

### Get Campaign overview

```php
require 'vendor/autoload.php';

use \Mailjet\Resources;

$mj = new \Mailjet\Client(
'xxx',
'yyy',
true,
['version' => 'v3']
);
try {
$response = $mj->get(Resources::$Campaignoverview);
print_r($response->getBody());


} catch (Throwable $throwable) {
print_r($throwable->getMessage());
}
```

## Contribute

Mailjet loves developers. You can be part of this project!
Expand Down
Loading

0 comments on commit 638c0a7

Please sign in to comment.