|
dolibarr 23.0.3
|


Public Member Functions | |
| __construct () | |
| Constructor of the class. | |
| deleteById ($id) | |
| Delete an email template. | |
| deleteByLAbel ($label) | |
| Delete an email template. | |
| getById ($id) | |
| Get properties of a email template by id. | |
| getByLabel ($label) | |
| Get properties of an email template by label. | |
| index ($sortfield="e.rowid", $sortorder='ASC', $limit=100, $page=0, $fk_user='', $sqlfilters='', $properties='', $pagination_data=false) | |
| List email templates. | |
| post ($request_data=null) | |
| Create an email template. | |
| putById ($id, $request_data=null) | |
| Update an email template. | |
| putbyLabel ($label, $request_data=null) | |
| Update an email template. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _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. | |
| _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, $label='') | |
| Get properties of an email template. | |
| _validate ($data) | |
| Validate fields before create or update object. | |
| _checkAccessRights ($accesstype) | |
| function to check for access rights - should probably have 1. | |
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 32 of file api_emailtemplates.class.php.
|
private |
function to check for access rights - should probably have 1.
parameter which is read/write/delete/... Why a separate function? because we probably needs to check so many many different kinds of objects
| string | $accesstype | accesstype: read, write, delete, ... |
| RestException | 403 |
Definition at line 630 of file api_emailtemplates.class.php.
References isModEnabled().
Referenced by _fetch(), deleteById(), deleteByLAbel(), index(), post(), putById(), and putbyLabel().
|
protected |
Clean sensible object datas @phpstan-template T.
| Object | $object | Object to clean @phan-param CEmailTemplate $object @phpstan-param T $object |
Reimplemented from DolibarrApi.
Definition at line 514 of file api_emailtemplates.class.php.
References $object, and dol_syslog().
|
private |
Get properties of an email template.
Return an array with email templates
| int | $id | ID of email_template |
| string | $label | Label of email_template |
| RestException | 400 |
| RestException | 403 |
| RestException | 404 |
Definition at line 471 of file api_emailtemplates.class.php.
References $id, _checkAccessRights(), and _cleanObjectDatas().
Referenced by getById(), getByLabel(), putById(), and putbyLabel().
|
private |
Validate fields before create or update object.
| ?array<string,null|int|string> | $data Data to validate |
| RestException | 400 |
Definition at line 609 of file api_emailtemplates.class.php.
Referenced by post().
| EmailTemplates::deleteById | ( | $id | ) |
Delete an email template.
| int | $id | email template ID |
@url DELETE {id}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 88 of file api_emailtemplates.class.php.
References $id, and _checkAccessRights().
| EmailTemplates::deleteByLAbel | ( | $label | ) |
Delete an email template.
| string | $label | email template label |
@url DELETE label/{label}
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 126 of file api_emailtemplates.class.php.
References _checkAccessRights().
| EmailTemplates::getById | ( | $id | ) |
Get properties of a email template by id.
Return an array with email template information
| int | $id | ID of email template |
@url GET {id}
| RestException | 403 |
| RestException | 404 |
Definition at line 165 of file api_emailtemplates.class.php.
| EmailTemplates::getByLabel | ( | $label | ) |
Get properties of an email template by label.
Return an array with order information
| string | $label | Label of object |
@url GET label/{label}
| RestException | 403 |
| RestException | 404 |
Definition at line 185 of file api_emailtemplates.class.php.
References _fetch().
| EmailTemplates::index | ( | $sortfield = "e.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $fk_user = '', | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List email templates.
Get a list of email templates
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $fk_user | User ids to filter email templates of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(e.active:=:1) and (e.module:=:'adherent')" |
| 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
| RestException | 404 Not found |
| RestException | 503 Error |
Definition at line 212 of file api_emailtemplates.class.php.
References _checkAccessRights(), _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
| EmailTemplates::post | ( | $request_data = null | ) |
Create an email template.
Example: {"module":"adherent","type_template":"member","active": 1,"label":"(SendingEmailOnAutoSubscription)","fk_user":0,"joinfiles": "0", ... } Required: {"label":"myBestTemplate","topic":"myBestOffer","type_template":"propal_send"}
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url POST
| RestException | 400 |
| RestException | 403 |
| RestException | 500 |
Definition at line 308 of file api_emailtemplates.class.php.
References _checkAccessRights(), DolibarrApi\_checkValForAPI(), _validate(), and sanitizeVal().
| EmailTemplates::putById | ( | $id, | |
| $request_data = null ) |
Update an email template.
Example: {"module":"adherent","type_template":"member","active": 1,"label":"(SendingEmailOnAutoSubscription)","fk_user":0,"joinfiles": "0", ... } Required: {"label":"myBestTemplate","topic":"myBestOffer","type_template":"propal_send"}
| int | $id | Id of order to update |
| array | $request_data | Data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT {id}
| RestException | 400 |
| RestException | 403 |
| RestException | 404 |
| RestException | 500 |
Definition at line 361 of file api_emailtemplates.class.php.
References $id, _checkAccessRights(), DolibarrApi\_checkValForAPI(), _fetch(), and sanitizeVal().
| EmailTemplates::putbyLabel | ( | $label, | |
| $request_data = null ) |
Update an email template.
Example: {"module":"adherent","type_template":"member","active": 1,"label":"(SendingEmailOnAutoSubscription)","fk_user":0,"joinfiles": "0", ... } Required: {"label":"myBestTemplate","topic":"myBestOffer","type_template":"propal_send"}
| string | $label | Label of order to update |
| array | $request_data | Data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT label/{label}
| RestException | 400 |
| RestException | 404 |
| RestException | 500 |
Definition at line 416 of file api_emailtemplates.class.php.
References _checkAccessRights(), DolibarrApi\_checkValForAPI(), _fetch(), and sanitizeVal().