dolibarr/htdocs/includes/modules/mailings
2008-12-07 19:19:32 +00:00
..
.cvsignore Exclude personal files 2008-04-27 02:24:55 +00:00
example.modules.php New: Add a module to select email targets from a file in email module 2008-08-01 20:59:33 +00:00
fraise.modules.php Removed all now() and sysdate() database sql inline function by a date defined by PHP ($db->idate(mktime())). 2008-08-27 18:53:27 +00:00
kiwi.modules.php Fix: elimination of product categories from the dropdown 2008-10-16 23:36:44 +00:00
modules_mailings.php New: Add a module to select email targets from a file in email module 2008-08-01 20:59:33 +00:00
peche.modules.php Add option to set mask on new files 2008-10-21 21:27:20 +00:00
poire.modules.php Can use several root directories. 2008-12-07 19:19:32 +00:00
pomme.modules.php New: Add a module to select email targets from a file in email module 2008-08-01 20:59:33 +00:00
README New: Can make mailing on prospects with a particular level. 2008-04-04 11:16:00 +00:00

README (english)
------------------------------------
Adding your own email selector module
------------------------------------


If you want to add your own emails selector/import module. This is steps to follow
to add you own email predefined selector:


***** STEP 1 *****

Copy file
htdocs/includes/modules/mailings/example.modules.php
into
htdocs/includes/modules/mailings/myselector.modules.php

You can choose value of your choice instead of "myselector" in name
of new file.


***** STEP 2 *****

Edit this file myselector.modules.php and change following text:

"class mailing_example"           into    "class mailing_myselector"
"var $name='example';"            into    var $name='myselector';
"var $desc='...';"                into    var $desc='A text to describe selector';
"function mailing_example"        into    "function mailing_myselector"

Then add code inside the "add_to_target" function. What you must do is simply
fill the $target PHP array with one record for each email your selector must return.

You can choose the way you get data: From a file, a database. You are free,
the only requirement is that the $target array is filled by records that are
themselves array of: ('email', 'name', 'firstname').

This is for example how you can fill the $target array:

// ----- Your code start here -----
$target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0');
...
$target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n');
// ----- Your code end here -----



***** STEP 3 *****

Once this file has been edited, you can go to the Dolibarr emailing feature,
you will see a new line selector in the "targets" editor of emailing tool.