• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI3 inline images in email using buffer string

#2
Just for reference, I extended the Email class with a custom method to be used with buffer strings:
Code:
    public function buffered_attachment_cid($filename)
    {
        for ($i = 0, $c = count($this->_attachments); $i < $c; $i++)
        {

            for ( $j = 0, $n = count( $this->_attachments[$i]['name'] ); $j < $n; $j++ )
            {
                if ($this->_attachments[$i]['name'][$j] === $filename)
                {
                    $this->_attachments[$i]['multipart'] = 'related';
                    $this->_attachments[$i]['cid'] = uniqid(basename($this->_attachments[$i]['name'][$j]).'@');
                    return $this->_attachments[$i]['cid'];
                }
            }
        }

        return FALSE;
    }
This one handles inline buffer string images correctly.
Reply


Messages In This Thread
RE: CI3 inline images in email using buffer string - by ludis - 02-16-2021, 01:35 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.