|
dolibarr 24.0.0-beta
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get a mass mailing. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $fk_projects='', $sqlfilters='', $properties='', $pagination_data=false, $loadlinkedobjects=0) | |
| List mass mailings. | |
| indexTargets ($id, $sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='', $pagination_data=false) | |
| List mass mailing targets. | |
| clone ($id, $cloneContent=1, $cloneRecipients=1, $notrigger=0) | |
| Clone a mass mailing. | |
| post ($request_data=null) | |
| Create a mass mailing. | |
| put ($id, $request_data=null) | |
| Update a mass mailing general fields (won't change lines of mass mailing) | |
| delete ($id) | |
| Delete a mass mailing. | |
| updateTarget ($id, $targetid, $request_data=null) | |
| Update a mass mailing general fields (won't change lines of mass mailing) | |
| postTarget ($id, $request_data=null) | |
| Create a mass mailing. | |
| getTarget ($id, $targetid) | |
| Get a target in a mass mailing. | |
| deleteTarget ($id, $targetid) | |
| Delete a mass mailing general fields (won't change lines of mass mailing) | |
| deleteTargets ($id) | |
| Delete targets of a mass mailing. | |
| resetTargetsStatus ($id) | |
| reset target status of a mass mailing | |
| settodraft ($id) | |
| Set a mass mailing to draft. | |
| validate ($id) | |
| Validate a mass mailing. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanTargetDatas ($object) | |
| Clean sensible object (mailing target) datas. | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas @phpstan-template T. | |
Protected Member Functions inherited from DolibarrApi | |
| _checkValForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _checkValExtrafieldsForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _filterObjectProperties ($object, $properties) | |
| Filter properties that will be returned on object. | |
| _checkFilters ($sqlfilters, &$error='') | |
| Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
| _fetch ($id) | |
| Get properties of an mailing object. | |
| _fetchTarget ($id, $targetid) | |
| Get properties of an mailing object. | |
| _validate ($data) | |
| Validate fields before create or update object. | |
| _validateTarget ($data) | |
| Validate fields before create or update object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') |
| Check access by user to a given resource. | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 33 of file api_mailings.class.php.
|
protected |
Clean sensible object datas @phpstan-template T.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 1158 of file api_mailings.class.php.
References $object.
Referenced by _fetch(), index(), settodraft(), and validate().
|
protected |
Clean sensible object (mailing target) datas.
| Object | $object | Object to clean |
Definition at line 1021 of file api_mailings.class.php.
References $object.
Referenced by _fetchTarget(), and indexTargets().
|
private |
Get properties of an mailing object.
Return an array with mailing information
| int | $id | ID of mailing object |
| RestException |
Definition at line 100 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Referenced by get().
|
private |
Get properties of an mailing object.
Return an array with mailing information
| int | $id | ID of mailing object |
| int | $targetid | Id mass mailing target |
| RestException | 403 |
| RestException | 404 |
Definition at line 694 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanTargetDatas().
Referenced by getTarget().
|
private |
Validate fields before create or update object.
| ?array<string,string> | $data Array with data to verify |
| RestException |
Definition at line 976 of file api_mailings.class.php.
Referenced by post().
|
private |
Validate fields before create or update object.
| ?array<string,string> | $data Array with data to verify |
| RestException |
Definition at line 999 of file api_mailings.class.php.
Referenced by postTarget().
| Mailings::clone | ( | $id, | |
| $cloneContent = 1, | |||
| $cloneRecipients = 1, | |||
| $notrigger = 0 ) |
Clone a mass mailing.
| int | $id | Id of object to clone |
| int | $cloneContent | 1=Clone content (default), 0=Forget content |
| int | $cloneRecipients | 1=Clone recipients (default), 0=Forget recipients |
| int | $notrigger | 1=Disable triggers, 0=Active triggers if any (default) |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 356 of file api_mailings.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Mailings::delete | ( | $id | ) |
Delete a mass mailing.
| int | $id | Mass mailing ID |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 498 of file api_mailings.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Mailings::deleteTarget | ( | $id, | |
| $targetid ) |
Delete a mass mailing general fields (won't change lines of mass mailing)
| int | $id | Id of mass mailing with the targetid to delete |
| int | $targetid | Id mass mailing target to delete |
@url DELETE {id}/deleteTarget/{targetid}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 740 of file api_mailings.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Mailings::deleteTargets | ( | $id | ) |
Delete targets of a mass mailing.
| int | $id | Mass mailing ID |
@url DELETE {id}/deleteTargets
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 792 of file api_mailings.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Mailings::get | ( | $id | ) |
Get a mass mailing.
Return an array with mass mailing information
| int | $id | ID of mass mailing |
| RestException |
Definition at line 85 of file api_mailings.class.php.
| Mailings::getTarget | ( | $id, | |
| $targetid ) |
Get a target in a mass mailing.
Return an array with info about a mass mailing target
| int | $id | Id of mass mailing with the targetid to get |
| int | $targetid | Id mass mailing target to get |
@url GET {id}/getTarget/{targetid}
| RestException |
Definition at line 677 of file api_mailings.class.php.
References $id, and _fetchTarget().
Referenced by updateTarget().
| Mailings::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $fk_projects = '', | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false, | |||
| $loadlinkedobjects = 0 ) |
List mass mailings.
Get a list of mass mailings
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $fk_projects | Project ids to filter mass mailings (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'2016-01-01')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
| int | $loadlinkedobjects | Load also linked object |
| RestException | 400 |
| RestException | 403 |
Definition at line 147 of file api_mailings.class.php.
References DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and dol_syslog().
| Mailings::indexTargets | ( | $id, | |
| $sortfield = "t.rowid", | |||
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List mass mailing targets.
Get a list of mass mailing targets
| int | $id | Mass mailing ID |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.lastname:like:'John Doe') and (t.statut:=:3)" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* |
@url GET {id}/targets
| RestException | 400 |
| RestException | 403 |
| RestException | 404 |
Definition at line 258 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanTargetDatas(), DolibarrApi\_filterObjectProperties(), and dol_syslog().
| Mailings::post | ( | $request_data = null | ) |
Create a mass mailing.
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 403 |
| RestException | 500 System error |
Definition at line 395 of file api_mailings.class.php.
References DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), _validate(), and sanitizeVal().
| Mailings::postTarget | ( | $id, | |
| $request_data = null ) |
Create a mass mailing.
| int | $id | Id of mass mailing to create a target for |
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST {id}/createTarget
| RestException | 400 |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 612 of file api_mailings.class.php.
References DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), _validateTarget(), and sanitizeVal().
| Mailings::put | ( | $id, | |
| $request_data = null ) |
Update a mass mailing general fields (won't change lines of mass mailing)
| int | $id | Id of mass mailing to update |
| array | $request_data | Datas @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 440 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValExtrafieldsForAPI(), DolibarrApi\_checkValForAPI(), and sanitizeVal().
| Mailings::resetTargetsStatus | ( | $id | ) |
reset target status of a mass mailing
| int | $id | Mass mailing ID |
@url PUT {id}/resetTargetsStatus
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 839 of file api_mailings.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Mailings::settodraft | ( | $id | ) |
Set a mass mailing to draft.
| int | $id | Mass mailing ID |
@url PUT {id}/settodraft
| RestException | 304 |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 885 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Mailings::updateTarget | ( | $id, | |
| $targetid, | |||
| $request_data = null ) |
Update a mass mailing general fields (won't change lines of mass mailing)
| int | $id | Id of mass mailing with the targetid to update |
| int | $targetid | Id mass mailing target to update |
| array | $request_data | Datas @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT {id}/updateTarget/{targetid}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 546 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValForAPI(), getTarget(), and sanitizeVal().
| Mailings::validate | ( | $id | ) |
Validate a mass mailing.
If you get a bad value for param notrigger check that ou provide this in body { "notrigger": 0 }
| int | $id | Mass mailing ID |
@url PUT {id}/validate
| RestException | 304 |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 System error |
Definition at line 937 of file api_mailings.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().