burzum / cakephp-zurb-inky
Installs: 7 160
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=7.1.0
- cakephp/cakephp: ^3.5
- lorenzo/pinky: ^1.0
- pelago/emogrifier: ~3.1
Requires (Dev)
- cakephp/cakephp-codesniffer: ^3.0
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2021-09-15 01:13:48 UTC
README
A plugin to render Inky views. This will render HTML and CSS in a way it should work with most of the mail clients. It basically turns divs and external CSS files into very old fashioned tables and inline CSS so that the retarded mail implementations will hopefully display it correctly.
Libraries used by this plugin
Requires php 7.1
How to use it
Assuming you are using a custom mailer as explained here just set the view renderer for all mails of this mailer:
class MyExampleMailer extends Mailer { public function __construct(Email $email = null) { parent::__construct($email); $this->setViewRenderer('Burzum/ZurbInky.Inky'); } }
If you want to parse the CSS as inline CSS call setCssFiles()
in your views.
In your layout or action set the CSS files you want to use with Inky.
$this->setCssFiles([ 'one', 'two' ]);
The files are set using the same notation as UrlHelper::css()
and are looked up in the apps webroot/css
folder by default.
License
Copyright Florian Krämer
Licensed under The MIT License Redistributions of files must retain the above copyright notice.