Download the PHP package programmatordev/kinky without Composer
On this page you can find all versions of the php package programmatordev/kinky. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download programmatordev/kinky
More information about programmatordev/kinky
Files in programmatordev/kinky
Package kinky
Short Description Inky email templating language for Kirby CMS
License MIT
Homepage https://github.com/programmatordev/kinky
Informations about the package kinky
Kinky
Inky email templating language for Kirby CMS.
Converts simple HTML tags into the complex table required for emails. Oh là là!
Table of Contents
- TL;DR
- How it Works
- Requirements
- Installation
- Usage
- transformTemplate
- Cookbook
TL;DR
Building HTML emails is painful.
You're stuck using archaic table-based layouts, and you constantly have to fight against inconsistent rendering across outdated email clients (like Outlook). Modern web standards? Mostly ignored.
To make life easier, this plugin was created so you can write cleaner code and still get reliable results across all major email clients.
How it Works
This plugin streamlines HTML email development by integrating a transpiler and inliner workflow built around Inky.
It uses a transpiler that converts Inky's custom components into table-based HTML, ensuring compatibility with legacy email clients.
After that, it passes the output through a CSS inliner that merges both Inky's default styles and any custom CSS into inline styles.
The result is clean, reliable HTML emails that render consistently across major clients like Outlook, Gmail, and Apple Mail — without giving up modern development convenience.
Example
Simple usage of Inky base components (it is recommended to include the body
class to enable responsive columns):
Transformed HTML (clean example without the whole document and CSS inlining):
Requirements
- PHP
8.2
or higher; - PHP
dom
extension; - Kirby CMS
4.0
or higher.
Installation
Install the plugin via Composer:
Usage
A global kinky()
function is available to create and send emails.
transformTemplate
Returns the final transformed HTML from the given $template
.
Take into account that email templates must be located in the /site/templates/emails/
directory.
[!NOTE] Check the documentation regarding how emails work in Kirby.
You can pass data into the template using the $data
parameter.
This method can be useful to help creating and previewing email templates:
email
This method is basically a wrapper around the existing kirby()->email()
method, so it works the same way.
The only difference is that it transpiles and inlines the Inky components and CSS for you.
It is basically the sames as doing the following:
[!NOTE] Check the documentation regarding how emails work in Kirby.
Cookbook
Custom CSS
To use your own custom CSS, you can just include a <style>
element in the template and all selectors will be inlined for you.
Template:
Result:
Acknowledgments
Thank you to the authors of these libraries that make this plugin possible:
Contributing
Any form of contribution to improve this library (including requests) will be welcome and appreciated. Make sure to open a pull request or issue.
License
This project is licensed under the MIT license. Please see the LICENSE file distributed with this source code for further information regarding copyright and licensing.
All versions of kinky with dependencies
getkirby/composer-installer Version ^1.2
lorenzo/pinky Version ^1.1
tijsverkoyen/css-to-inline-styles Version ^2.3
ext-dom Version *