RegisterModel::sendActivationEmail PHP Метод

sendActivationEmail() публичный Метод

给指定用户发送激活账户邮件
public sendActivationEmail ( integer $uid, string $node = 'register_active' ) : boolean
$uid integer 用户UID
$node string 邮件模板类型
Результат boolean 是否发送成功
    public function sendActivationEmail($uid, $node = 'register_active')
    {
        $map['uid'] = $uid;
        $user_info = $this->_user_model->where($map)->find();
        if (!$user_info) {
            $this->_error = L('PUBLI_USER_NOTEXSIT');
            // 用户不存在
            return false;
        } elseif ($user_info['is_audit']) {
            if ($user_info['is_active'] == 1) {
                $config['activeurl'] = $GLOBALS['ts']['site']['home_url'];
            } else {
                $code = $this->getActivationCode($user_info);
                $config['activeurl'] = U('public/Register/activate', array('uid' => $uid, 'code' => $code));
            }
            $config['name'] = $user_info['uname'];
            model('Notify')->sendNotify($uid, $node, $config);
            $this->_error = '发送成功';
            // 系统已将一封激活邮件发送至您的邮箱,请立即查收邮件激活帐号
            return true;
        } else {
            $this->_error = !$user_info['is_audit'] ? L('PUBLIC_ACCOUNT_REVIEW_FAIL') : L('PUBLIC_ACCOUNT_ACTIVATED_SUCCESSFULLY');
            // 您的帐号未通过审核,恭喜,帐号已成功激活
            return false;
        }
    }