Welcome Guest, Not a member yet? Register   Sign In
Parser problems
#1

[eluser]Gukkie[/eluser]
Hi, im having some difficulty here.

It seems that after my user registers and an email gets sent, the next thing i know my email template(What has been sent to the users email) gets rendered out along with "echo "Success.... ".$username;" when the email has been successfully sent, is this normal?

Do i have to add a redirect to prevent this?

Code:
$emailData = array(
       'title'           => $email_subject,
       'email_body'      => $email_body_html,
       'activation_link' => anchor(base_url().'user/account_activation/'.$activationkey, 'Activate Now!'),
       'username'    => $username,
       'password'    => $password
     );
    
     $email_msg = $this->parser->parse('templates/email_template', $emailData);
    
     $this->email->clear(TRUE);
     $this->email->to($email);
     $this->email->from('[email protected]', 'Test');
     $this->email->subject($email_subject);
     $this->email->message($email_msg);
    
     if($this->email->send())
     {
      echo "Success.... ".$username;
     }
     else
     {
      // redirect to register with error
      exit();
     }

Cheers!




Theme © iAndrew 2016 - Forum software by © MyBB