desta88 / Codeigniter-Barcode

Create barcode generator for Codeigniter using Zend Library (Support Codeigniter 2 & 3)
MIT License
32 stars 52 forks source link

Zend Library #3

Open crg821 opened 8 years ago

crg821 commented 8 years ago

Want to send barcodes to a list of emails but when passing $this->set_barcode($temp) to the view, the view won't load the barcode. I wonder if Zend_Barcode or the Zend library is not orking is not working with CI 2.x.
MY CONTROLLER public function SendEmail($results){ foreach ($results->result() as $row) { $this->email->clear(TRUE); $temp = rand(10000, 99999); $email = $row->email_test; $fname = $row->fname_test; $bar_code = $this->set_barcode($temp); $email_data = []; $email_data = array('fname'=> $fname, 'email'=> $email, 'bar_code'=> $bar_code); $message = $this->load->view('pages/email_format', $email_data, TRUE); $this->email->to($email_data['email']); $this->email->from("crg@mydomain.com", "Some Person"); $this->email->subject("My Subject"); $this->email->message($message); $send = $this->email->send(); } } MY VIEW <?php echo $bar_code ?>

desta88 commented 8 years ago

I think the problem is, your barcode should be attached on mail. Try this '$this->email->print_debugger()' to debug your code.

crg821 commented 8 years ago

I am trying to pass the image from $this->set_barcode($temp) into the view Iload. So $message will contain other data and the image the function set_barcode() generates like so: $barcode = $this->set_barcode($temp); $email_data = array('fname' =>$fname, 'barcode'=>$barcode); $message = $this->load->view('path_to_view', $email_data, TRUE);

On Wed, Aug 31, 2016 at 5:11 AM, Andhika Desta Permana < notifications@github.com> wrote:

I think the problem is, your barcode should be attached on mail. Try this '$this->email->print_debugger()' to debug your code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/desta88/Codeigniter-Barcode-Generator-Zend-Library/issues/3#issuecomment-243720091, or mute the thread https://github.com/notifications/unsubscribe-auth/AEHp6c5uboM7VHA2Q__94iN2vlWJqd92ks5qlVNOgaJpZM4JwKYr .

bambanguzumaki11 commented 7 years ago

public function SendEmail($results){foreach ($results->result() as $row){$this->email->clear(TRUE);$temp = rand(10000, 99999);$email = $row->email_test;$fname = $row->fname_test;$bar_code = $this->set_barcode($temp);$email_data = [];$email_data = array('fname'=> $fname, 'email'=> $email, 'bar_code'=> $bar_code);$message = $this->load->view('pages/email_format', $email_data, TRUE);$this->email->to($email_data['email']);$this->email->from("crg@mydomain.com", "Some Person");$this->email->subject("My Subject");$this->email->message($message);$send = $this->email->send();}}MY VIEW<?php echo $bar_code ?>

destaFog commented 5 years ago

@bambanguzumaki11 beutify your code please ..