Add deleteList documentation

[MAILPOET-4752]
This commit is contained in:
Jan Lysý
2022-10-27 08:47:08 +02:00
committed by Aschepikov
parent f6a5e0117c
commit 933b947f45
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
[back to list](../Readme.md)
# Delete List
## `bool deleteList(string $list_id)`
This method provides functionality for deleting a new list.
It returns a boolean value.
## Error handling
All expected errors from the API are exceptions of class `\MailPoet\API\MP\v1\APIException`.
Code of the exception is populated to distinguish between different errors.
An exception of base class `\Exception` can be thrown when something unexpected happens.
Codes description:
| Code | Description |
| ---- | --------------------------------------------------------------- |
| 5 | List does not exist |
| 18 | List id is empty |
| 20 | List cannot be deleted because its used for an automatic email |
| 21 | List cannot be deleted because its used for a form |
| 22 | The list couldnt be deleted from the database |