dolibarr  7.0.0-beta
Public Member Functions | List of all members
mailing_example Class Reference

Class to manage a list of personalised recipients for mailing feature. More...

+ Inheritance diagram for mailing_example:
+ Collaboration diagram for mailing_example:

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 add_to_target ($mailing_id, $filtersarray=array())
 This is the main function that returns the array of emails. More...
 
 getSqlArrayForStats ()
 On the main mailing area, there is a box with statistics. More...
 
 getNbOfRecipients ($sql='')
 Return here number of distinct emails returned by your selector. More...
 
 formFilter ()
 This is to add a form filter to provide variant of selector If used, the HTML select must be called "filter". More...
 
 url ($id)
 Can include an URL link on each record provided by selector shown on target page. More...
 
- Public Member Functions inherited from MailingTargets
 __construct ($db)
 Constructor. More...
 
 getDesc ()
 Return description of email selector. More...
 
 getNbOfRecords ()
 Return number of records for email selector. More...
 
 getNbOfRecipients ($sql)
 Retourne nombre de destinataires. More...
 
 formFilter ()
 Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings. More...
 
 update_nb ($mailing_id)
 Met a jour nombre de destinataires. More...
 
 add_to_target ($mailing_id, $cibles)
 Ajoute destinataires dans table des cibles. More...
 
 clear_target ($mailing_id)
 Supprime tous les destinataires de la table des cibles. More...
 

Detailed Description

Class to manage a list of personalised recipients for mailing feature.

Definition at line 26 of file example.modules.php.

Constructor & Destructor Documentation

mailing_example::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 49 of file example.modules.php.

Member Function Documentation

mailing_example::add_to_target (   $mailing_id,
  $filtersarray = array() 
)

This is the main function that returns the array of emails.

Parameters
int$mailing_idId of mailing. No need to use it.
array$filtersarrayIf you used the formFilter function. Empty otherwise.
Returns
int <0 if error, number of emails added if ok

Definition at line 62 of file example.modules.php.

mailing_example::formFilter ( )

This is to add a form filter to provide variant of selector If used, the HTML select must be called "filter".

Returns
string A html select zone

Definition at line 123 of file example.modules.php.

mailing_example::getNbOfRecipients (   $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.

Parameters
string$sqlRequete sql de comptage
Returns
int|string Number of recipient or '?'

Definition at line 108 of file example.modules.php.

mailing_example::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".

Returns
array Array with SQL requests

Definition at line 90 of file example.modules.php.

mailing_example::url (   $id)

Can include an URL link on each record provided by selector shown on target page.

Parameters
int$idID
Returns
string Url link

Definition at line 139 of file example.modules.php.


The documentation for this class was generated from the following file: