So i have written a custom module to do some stuff, but part of that stuff is to register a new member into EE. All of that is working great, but, it doesn't send the self activation email out (even though EE is configured too).
I have no idea what i'm missing here codewise? From looking through the EE code, it should send the email. I get no errors either.
$this->EE->load->model('member_model');
$this->EE->load->helper('security');
$data['username'] = $this->input->post('username');
$data['password'] = do_hash($this->input->post('password'));
$data['email'] = $this->EE->input->post('email');
$data['ip_address'] = $this->EE->input->ip_address();
$data['unique_id'] = random_string('encrypt');
$data['join_date'] = $this->EE->localize->now;
$data['language'] = $this->EE->config->item('deft_lang');
$data['timezone'] = ($this->EE->config->item('default_site_timezone') && $this->EE->config->item('default_site_timezone') != '') ? $this->EE->config->item('default_site_timezone') : $this->EE->config->item('server_timezone');
$data['daylight_savings'] = ($this->EE->config->item('default_site_dst') && $this->EE->config->item('default_site_dst') != '') ? $this->EE->config->item('default_site_dst') : $this->EE->config->item('daylight_savings');
$data['time_format'] = ($this->EE->config->item('time_format') && $this->EE->config->item('time_format') != '') ? $this->EE->config->item('time_format') : 'us';
$data['group_id'] = 1;
if ($this->EE->member_model->get_members('', '', '', $data['username'], '', 'username')->num_rows() > 0)
{
$this->EE->output->show_user_error('submission', 'Username already exists!!!!');
}
$member_id = $this->EE->member_model->create_member($data);
$this->EE->member_model->delete_member($member_id);