EllisLab/CodeIgniter — Issue #660: Make _build_message in Email library protected
Author: danfraticiu
Created: 2011-11-10 13:39:47+00:00
State: open

I'd like the ability to name my attachments, so I subclassed the Email library, overriden the attached function to accept a new parameth ($filename_email), and in it I save the $filename_email in a new member array (Email::_attach_name_email).

And now I need to alter the _build_message function and swap the line 1130:

$basename = basename($filename);

to

if (!is_null($this->_attach_name_email[$i])){
$basename = $this->_attach_name_email[$i];
}
else{
$basename = basename($filename);
}

But I can't because the _build_message is private.

Better still maybe we can include this minor update in the next version of CI ;)

PS: in the mean time I'm just gonna alter the core library.