Skip to content
Extend Network/Email/CakeEmail allowing embedded image inline in templates.
PHP
Branch: CakePHP-3
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
composer.json

README.md

Package at Packagist GitHub license

FawnoEmail

Extend Cake\Mailer\Email allowing image inline in templates.

Install via composer

Since v3, CakePHP uses composer, the easiest way to set up is by either running

  composer require fawno/fawnoemail

Usage

Whenever you need to send email, ensure this class is loaded:

  use Fawno\Mailer\FawnoEmail;

Use the class as normal CakeEmail:

  $email = new FawnoEmail();
  $email->to(array('example@example.com' => 'Example'));
  $email->subject('Example Email');
  $email->template('default');
  $email->send();

In template:

  <img src="cid:/full/path/image">
  <img src="cid:///full/path/image">
  <img src="file:/full/path/image">
  <img src="file:///full/path/image">
  echo $this->Html->image('cid:///full/path/image');
  echo $this->Html->image('file:///full/path/image');
You can’t perform that action at this time.