X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fmarketing.inc.php;h=c8fbb9ac20cb1c347d1be54356a6397a70ce3c2f;hb=7c09ce41dca26e3016b843c458092e0d278604a0;hp=83ca858ab878b5e07b4a40c37816878d2636d7cf;hpb=612a2d8ae13ee29edb3279132877b63db18a5da5;p=platal.git diff --git a/include/validations/marketing.inc.php b/include/validations/marketing.inc.php index 83ca858..c8fbb9a 100644 --- a/include/validations/marketing.inc.php +++ b/include/validations/marketing.inc.php @@ -1,6 +1,6 @@ m_id = $mark_id; $this->m_email = $email; $this->perso = $perso; + $this->m_type = $type; + $this->m_data = $data; $res = XDB::query('SELECT u.nom, u.prenom, u.promo FROM auth_user_md5 AS u WHERE user_id = {?} GROUP BY u.user_id', $mark_id); - list ($this->m_nom, $this->m_prenom, $this->m_promo) = $res->fetchOneRow(); + list ($this->m_nom, $this->m_prenom, $this->m_promo) = $res->fetchOneRow(); } // }}} @@ -71,7 +75,7 @@ class MarkReq extends Validate // }}} // {{{ function _mail_subj - + protected function _mail_subj() { return "[Polytechnique.org] Marketing de {$this->m_prenom} {$this->m_nom} ({$this->m_promo})"; @@ -97,8 +101,11 @@ class MarkReq extends Validate public function commit() { - require_once('marketing.inc.php'); - mark_send_mail($this->m_id, $this->m_email,(!$this->perso)?"staff":"user"); + $market = Marketing::get($this->m_id, $this->m_email); + if ($market == null) { + return false; + } + $market->send(); return true; }