24include_once DOL_DOCUMENT_ROOT.
'/core/modules/mailings/modules_mailings.php';
25require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 public $name =
'EmailsFromUser';
35 public $desc =
'EMails input by user';
36 public $require_module = array();
37 public $require_admin = 0;
42 public $picto =
'generic';
43 public $tooltip =
'UseFormatInputEmailToTarget';
68 $langs->load(
"users");
95 public function url($id)
111 $s .=
'<input type="text" name="xinputuser" class="flat minwidth300" value="'.GETPOST(
"xinputuser").
'">';
125 global $conf, $langs, $_FILES;
127 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
129 $tmparray = explode(
';',
GETPOST(
'xinputuser'));
131 $email = $tmparray[0];
132 $lastname = empty($tmparray[1]) ?
'' : $tmparray[1];
133 $firstname = empty($tmparray[2]) ?
'' : $tmparray[2];
134 $other = empty($tmparray[3]) ?
'' : $tmparray[3];
137 if (!empty($email)) {
138 if (isValidEMail($email)) {
141 'lastname' => $lastname,
142 'firstname' => $firstname,
146 'source_type' =>
'file'
149 return parent::addTargetsToDatabase($mailing_id, $cibles);
151 $langs->load(
"errors");
152 $this->error = $langs->trans(
"ErrorBadEMail", $email);
156 $langs->load(
"errors");
157 $this->error = $langs->trans(
"ErrorBadEmail", $email);
Parent class of emailing target selectors modules.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.