Mailings
class Mailings extends DolibarrApi (View source)
API class for mass mailings
Properties
| protected DoliDB | $db | from DolibarrApi | |
| Restler | $r | from DolibarrApi | |
| static string[] | $FIELDS | ||
| static string[] | $TARGETFIELDS | ||
| Mailing | $mailing | ||
| MailingTarget | $mailing_target |
Methods
Constructor
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.
Get a mass mailing
List mass mailings
List mass mailing targets
Clone a mass mailing
Create a mass mailing
Update a mass mailing general fields (won't change lines of mass mailing)
Delete a mass mailing
Update a mass mailing general fields (won't change lines of mass mailing)
Create a mass mailing
Get a target in a mass mailing
Delete a mass mailing general fields (won't change lines of mass mailing)
Delete targets of a mass mailing
reset target status of a mass mailing
Set a mass mailing to draft
Validate a mass mailing
Clean sensible object (mailing target) datas
Details
__construct()
Constructor
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
object
get(int $id)
Get a mass mailing
Return an array with mass mailing information
array
index(string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $fk_projects = '', string $sqlfilters = '', string $properties = '', bool $pagination_data = false, int $loadlinkedobjects = 0)
List mass mailings
Get a list of mass mailings
array
indexTargets(int $id, string $sortfield = "t.rowid", string $sortorder = 'ASC', int $limit = 100, int $page = 0, string $sqlfilters = '', string $properties = '', bool $pagination_data = false)
List mass mailing targets
Get a list of mass mailing targets
object
clone(int $id, int $cloneContent = 1, int $cloneRecipients = 1, int $notrigger = 0)
Clone a mass mailing
int
post(array $request_data = null)
Create a mass mailing
object
put(int $id, array $request_data = null)
Update a mass mailing general fields (won't change lines of mass mailing)
array
delete(int $id)
Delete a mass mailing
object
updateTarget(int $id, int $targetid, array $request_data = null)
Update a mass mailing general fields (won't change lines of mass mailing)
int
postTarget(int $id, array $request_data = null)
Create a mass mailing
object
getTarget(int $id, int $targetid)
Get a target in a mass mailing
Return an array with info about a mass mailing target
array
deleteTarget(int $id, int $targetid)
Delete a mass mailing general fields (won't change lines of mass mailing)
array
deleteTargets(int $id)
Delete targets of a mass mailing
array
resetTargetsStatus(int $id)
reset target status of a mass mailing
object
settodraft(int $id)
Set a mass mailing to draft
object
validate(int $id)
Validate a mass mailing
If you get a bad value for param notrigger check that ou provide this in body { "notrigger": 0 }
protected object
_cleanTargetDatas(object $object)
Clean sensible object (mailing target) datas