Welcome Guest, Not a member yet? Register   Sign In
Codeigniter sending blank emails when more then one email is sent in a single request
#9

So, I changed my code for the send_email() method to this:

PHP Code:
public function send_email($email,$to,$data=array()) {

        
$func '_email_'.$email;

        if( 
method_exists($this,$func) ) {
            
            
$email $this->$func($data);

            if( 
$email ) {

                    
$this->email->to($to); 

                    
$this->email->from($this->config->item('app_email_from'), $this->config->item('app_email_from_name'));
                    
                    
$this->email->subject($email['subject']);

                    
$message $this->load->view('emails/_wrapper',array('body'=>$email['body']),true);

                    
var_dump($message);

                    echo 
'<hr>';
                    
                    
$this->email->message$message );
                    
                    
$result $this->email->send();

            }

        }

    } 

and it turns out $message is loaded properly the first time, but on subsequent attempts to set the value of $message I just get an empty string? So for whatever reason CI isn't loading the _wrapper view properly after the first time.
Reply


Messages In This Thread
RE: Codeigniter sending blank emails when more then one email is sent in a single request - by webdev25 - 09-21-2015, 09:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB