mailing_pomme
class mailing_pomme extends MailingTargets (View source)
Class to offer a selector of emailing targets with Rule 'Pomme'.
Properties
| DoliDB | $db | from MailingTargets | |
| string | $error | from MailingTargets | |
| string[] | $errors | from MailingTargets | |
| string | $enabled | from MailingTargets | |
| string | $name | ||
| string | $desc | ||
| string | $tooltip | from MailingTargets | |
| string | $sql | from MailingTargets | |
| int<0, 1> | $evenunsubscribe | from MailingTargets | |
| string[] | $require_module | ||
| int | $require_admin | ||
| string | $picto |
Methods
Constructor
Return here number of distinct emails returned by your selector.
Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
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.
Ajoute destinataires dans table des cibles
Provide the URL to the car of the source information of the recipient for the mailing
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 = '')
Return here number of distinct emails returned by your selector.
For example if this selector is used to extract 500 different emails from a text file, this function must return 500.
string
formFilter()
Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
@return string Retourne zone select
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)
Ajoute destinataires dans table des cibles
@param int $mailing_id Id of emailing
string
url($id)
Provide the URL to the car of the source information of the recipient for the mailing
@param int $id ID