Files
piratepoet/doc/api_methods/DeleteList.md
2022-11-02 14:05:39 +01:00

1.1 KiB
Raw Blame History

back to list

Delete List

bool deleteList(string $list_id)

This method provides functionality for deleting a list that is of the type 'default'.

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
23 Only lists of the type 'default' can be deleted