MailingTargets
class MailingTargets (View source)
Parent class of emailing target selectors modules
Properties
| DoliDB | $db | ||
| string | $error | ||
| string[] | $errors | ||
| string | $enabled | ||
| string | $name | ||
| string | $desc | ||
| string | $tooltip | ||
| string | $sql | ||
| int<0, 1> | $evenunsubscribe |
Methods
Constructor
Return description of email selector
Return number of records for email selector
Retourne nombre de destinataires
Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
Met a jour nombre de destinataires
Add a list of targets into the database
Supprime tous les destinataires de la table des cibles
Return list of widget. Function used by admin page htdoc/admin/widget.
On the main mailing area, there is a box with statistics.
Add destinations in the targets table
Details
__construct($db)
Constructor
@param DoliDB $db Database handler
string
getDesc()
Return description of email selector
getNbOfRecords()
Return number of records for email selector
@return integer Example
int|string
getNbOfRecipients(string $sql)
Retourne nombre de destinataires
string
formFilter()
Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
int
update_nb(int $mailing_id)
Met a jour nombre de destinataires
int
addTargetsToDatabase(int $mailing_id, array<array{fk_contact?: int, lastname: string, firstname: string, email: string, other: string, source_url: string, source_id?: int, source_type: string, id?: int}> $cibles)
Add a list of targets into the database
void
clear_target($mailing_id)
Supprime tous les destinataires de la table des cibles
@param int $mailing_id Id of emailing
static
getEmailingSelectorsList(?string[] $forcedir = null)
Return list of widget. Function used by admin page htdoc/admin/widget.
List is sorted by widget filename so by priority to run.
string[]
getSqlArrayForStats()
On the main mailing area, there is a box with statistics.
If you want to add a line in this report you must provide an array of SQL request that returns two field: One called "label", One called "nb".
int
add_to_target($mailing_id)
Add destinations in the targets table
@param int $mailing_id Id of emailing