- if (!$isok) return false;
- global $globals;
- $mailer = new PlMailer;
- $cc = "support+homonyme@".$globals->mail->domain;
- $FROM = "\"Support Polytechnique.org\" <$cc>";
- $mailer->setSubject($this->_mail_subj());
- $mailer->setFrom($FROM);
- $mailer->addTo("\"{$this->prenom} {$this->nom}\" <{$this->bestalias}@{$globals->mail->domain}>");
- $mailer->addCc($cc);
-
- $body = $this->prenom.",\n\n"
- . $this->_mail_body($isok)
- . (Env::has('comm') ? "\n\n".Env::v('comm') : '')
- . "\n\nCordialement,\n\n-- \nL'équipe de Polytechnique.org\n";
-
- $mailer->setTxtBody(wordwrap($body));
- $mailer->send();
+ if (!$isok) {
+ return false;
+ }
+
+ Platal::load('admin', 'homonyms.inc.php');
+ if ($this->warning) {
+ send_warning_homonym($this->user, $this->email);
+ } else {
+ send_robot_homonym($this->user, $this->email);
+ }