desta88 / Codeigniter-Barcode

Create barcode generator for Codeigniter using Zend Library (Support Codeigniter 2 & 3)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zend Library

crg821 opened this issue · comments

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 ?>

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

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
#3 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEHp6c5uboM7VHA2Q__94iN2vlWJqd92ks5qlVNOgaJpZM4JwKYr
.

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

@bambanguzumaki11 beutify your code please ..