EmailTemplates
class EmailTemplates extends DolibarrApi (View source)
API for handling Object of table llx_c_email_templates
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| static string[] | $INTFIELDS | ||
| CEmailTemplate | $email_template | ||
| string | $table_element |
Methods
Constructor of the class
Check and convert a string depending on its type/name.
Filter properties that will be returned on object
Clean sensible object datas
Check access by user to a given resource
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
Function to forge a SQL criteria from a Generic filter string.
Delete an email template
Delete an email template
Get properties of a email template by id
Get properties of an email template by label
List email templates
Create an email template
Update an email template
Update an email template
Details
__construct()
Constructor of the class
protected string|array<string, mixed>
_checkValForAPI(string $field, string|string[] $value, object $object)
Check and convert a string depending on its type/name.
protected object
_filterObjectProperties(object $object, string $properties)
Filter properties that will be returned on object
protected object
_cleanObjectDatas(object $object)
Clean sensible object datas
static protected bool
_checkAccessToResource(string $resource, int $resource_id = 0, string $dbtablename = '', string $feature2 = '', string $dbt_keyfield = 'fk_soc', string $dbt_select = 'rowid')
Check access by user to a given resource
protected bool|string
_checkFilters(string $sqlfilters, string $error = '')
Return if a $sqlfilters parameter is valid Function no more used. Kept for backward compatibility with old APIs of modules
static protected string
_forge_criteria_callback(string[] $matches)
Function to forge a SQL criteria from a Generic filter string.
Function no more used. Kept for backward compatibility with old APIs of modules
array
deleteById(int $id)
Delete an email template
array
deleteByLAbel(string $label)
Delete an email template
object
getById(int $id)
Get properties of a email template by id
Return an array with email template information
object
getByLabel(string $label)
Get properties of an email template by label
Return an array with order information
array
index(string $sortfield = "e.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $fk_user = '', string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List email templates
Get a list of email templates
int
post(array $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"}
object
putById(int $id, array $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"}
object
putbyLabel(string $label, array $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"}