Skip to content

Commit 1ca7505

Browse files
Merge pull request #280 from mailjet/DE-1220-resource-contacts-missing
Delete contact resource and example of usage
2 parents 2428034 + c9c1d97 commit 1ca7505

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,24 @@ $response->success() && var_dump($response->getData());
377377
?>
378378
```
379379

380+
```php
381+
<?php
382+
/*
383+
Delete a contact from contact list:
384+
*/
385+
require 'vendor/autoload.php';
386+
use \Mailjet\Resources;
387+
$mj = new \Mailjet\Client(
388+
getenv('MJ_APIKEY_PUBLIC'),
389+
getenv('MJ_APIKEY_PRIVATE'),
390+
true,
391+
['version' => 'v4']
392+
);
393+
$response = $mj->delete(Resources::$Contacts, ['ID' => xxxx]);
394+
$response->success() && var_dump($response->getData());
395+
?>
396+
```
397+
380398
### Response
381399

382400
The `get`, `post`, `put` and `delete` method will return a `Response` object with the following available methods:

src/Mailjet/Resources.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Mailjet;
1313

1414
/**
15-
* PHP version 7.2.
1615
*
1716
* This is the Mailjet Resources Class
1817
*
@@ -49,6 +48,7 @@ class Resources
4948
public static $Campaignstatistics = ['campaignstatistics', ''];
5049
public static $Clickstatistics = ['clickstatistics', ''];
5150
public static $Contact = ['contact', ''];
51+
public static $Contacts = ['contacts', ''];
5252
public static $ContactManagecontactslists = ['contact', 'managecontactslists'];
5353
public static $ContactGetcontactslists = ['contact', 'getcontactslists'];
5454
public static $ContactManagemanycontacts = ['contact', 'managemanycontacts'];

0 commit comments

Comments
 (0)