2 /* This file is part of Syj, Copyright (c) 2010 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 and all
23 your items will be deleted.
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 and
55 all your data have been deleted. Nevertheless, you can still create a new
58 Please do not reply this email. If you need to contact us, please use the form
59 contact at %contacturl%
63 Syj team", $this->_user->lang);
66 $text = str_replace('%user%', $this->_user->pseudo, $text);
67 $text = str_replace('%hashurl%', $this->getHashUrl(), $text);
68 $text = str_replace('%contacturl%', $this->getContactUrl(), $text);
70 return $this->_sendMail($subject, $text);
73 protected function _cancel() {
74 $mapper = new Syj_Model_UserMapper();
75 $mapper->delete($this->_user);