1README (english) 2------------------------------------ 3Adding your own email selector module 4------------------------------------ 5 6 7If you want to add your own emails selector/import module. This is steps to follow 8to add you own email predefined selector: 9 10 11***** STEP 1 ***** 12 13Copy file 14htdocs/core/modules/mailings/example.modules.php 15into 16htdocs/core/modules/mailings/myselector.modules.php 17 18You can choose value of your choice instead of "myselector" in name 19of new file. 20 21 22***** STEP 2 ***** 23 24Edit this file myselector.modules.php and change following text: 25 26"class mailing_example" into "class mailing_myselector" 27"var $name='example';" into var $name='myselector'; 28"var $desc='...';" into var $desc='A text to describe selector'; 29"function mailing_example" into "function mailing_myselector" 30 31Then add code inside the "add_to_target" function. What you must do is simply 32fill the $target PHP array with one record for each email your selector must return. 33 34You can choose the way you get data: From a file, a database. You are free, 35the only requirement is that the $target array is filled by records that are 36themselves array of: ('email', 'name', 'firstname', 'other'). 37 38This is for example how you can fill the $target array: 39 40// ----- Your code start here ----- 41$target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0', 'other'=>'other_0'); 42... 43$target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n', 'other'=>'other_n'); 44// ----- Your code end here ----- 45 46and call the method 47 48parent::addTargetsToDatabase($mailing_id, $target); 49 50 51***** STEP 3 ***** 52 53Once this file has been edited, you can go to the Dolibarr emailing feature, 54you will see a new line selector in the "targets" editor of emailing tool. 55 56