2 /* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_Model_Pending_ValidateCreation extends Syj_Model_Pending
7 protected $_action = 'validate_creation';
8 protected function _run() {
12 public function _notify() {
13 switch ($this->_notifications_number) {
15 $subject = $this->translate("[SYJ] Validate your account", $this->_user->lang);
16 $text = $this->translate("Hi %user%, and welcome on syj
18 Your account is currently active, but you need to confirm your inscription by
22 If you do not not confirm your inscription within 7 days, your account will be
25 Please do not reply this email. If you need to contact us, please use the form
26 contact at %contacturl%
30 Syj team", $this->_user->lang);
34 $subject = $this->translate("[SYJ] Reminder: Validate your account", $this->_user->lang);
35 $text = $this->translate("Hi %user%,
37 You need to validate your account on syj since 6 days. Otherwise, your
38 account will be deleted tomorrow. Please follow this link:
41 Please do not reply this email. If you need to contact us, please use the form
42 contact at %contacturl%
46 Syj team", $this->_user->lang);
51 $subject = $this->translate("[SYJ] Account deactivated", $this->_user->lang);
52 $text = $this->translate("Hi %user%,
54 You have not validated your syj account on time. Therefore, your account have
55 been deleted. Nevertheless, you can still create a new account.
57 Please do not reply this email. If you need to contact us, please use the form
58 contact at %contacturl%
62 Syj team", $this->_user->lang);
65 $text = str_replace('%user%', $this->_user->pseudo, $text);
66 $text = str_replace('%hashurl%', $this->getHashUrl(), $text);
67 $text = str_replace('%contacturl%', $this->getContactUrl(), $text);
69 return $this->_sendMail($subject, $text);
72 protected function _cancel() {
73 $mapper = new Syj_Model_UserMapper();
74 $mapper->delete($this->_user);