mailing_thirdparties_services_expired
class mailing_thirdparties_services_expired extends MailingTargets (View source)
Class to offer a selector of emailing targets with Rule 'services expired'.
Properties
| DoliDB | $db | from MailingTargets | |
| string | $error | from MailingTargets | |
| string[] | $errors | from MailingTargets | |
| string | $enabled | ||
| string | $name | ||
| string | $desc | ||
| string | $tooltip | from MailingTargets | |
| string | $sql | from MailingTargets | |
| int<0, 1> | $evenunsubscribe | from MailingTargets | |
| int | $require_admin | ||
| string[] | $require_module | ||
| string | $picto |
Methods
Constructor
Return here number of distinct emails returned by your selector.
This is to add a form filter to provide variant of selector If used, the HTML select must be called "filter"
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.
This is the main function that returns the array of emails
Can include an URL link on each record provided by selector shown on target page.
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()
This is to add a form filter to provide variant of selector If used, the HTML select must be called "filter"
@return string A html select zone
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)
This is the main function that returns the array of emails
@param int $mailing_id Id of mailing. No need to use it.
string
url($id)
Can include an URL link on each record provided by selector shown on target page.
@param int $id ID