Download the PHP package vysokeskoly/to-inline-style-email-bundle without Composer
On this page you can find all versions of the php package vysokeskoly/to-inline-style-email-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vysokeskoly/to-inline-style-email-bundle
More information about vysokeskoly/to-inline-style-email-bundle
Files in vysokeskoly/to-inline-style-email-bundle
Package to-inline-style-email-bundle
Short Description A Symfony bundle for using the CssToInlineStyles translator by tijsverkoyen
License MIT
Homepage http://github.com/vysokeskoly/ToInlineStyleEmailBundle
Informations about the package to-inline-style-email-bundle
ToInlineStyleEmailBundle
ToInlineStyleEmailBundle is a Symfony2 bundle to use the CssToInlineStyles translator by Tijs Verkoyen (see https://github.com/tijsverkoyen/CssToInlineStyles for the repository)
Requirements
ToInlineStyleEmailBundle is only supported on PHP 8.1 and up.
Installation
Please, use the Composer to install this bundle in your Symfony2 app.
The following lines should be added in your
Then, register the bundle in your AppKernel by adding the following line:
Documentation and Examples
The bundle provides a service named css_to_inline_email_converter. Use it in a controller to have a nice shortcut to the converter developed by Tijs Verkoyen. E.g.:
Get the HTML and the CSS as a string and set this required values to the converter object, e.g.
The retrieval of the HTML and CSS files from its folder it is only up-to you. E.g. in your controller retrieve the content of your CSS as:
Of course, it is supposed that a Symfony user will use a template instead of a static HTML page. Hence, for convenience, the service provides a function capable to render a template. E.g.:
The preceding function must be used in vece of function .
To use the method just use it like:
You can use inline css directly in Twig template:
Paths relative to bundle are supported as well:
Dynamic variable is supported (Use absolute path with variable with asset or directly with full path to file)
Dynamic variable is supported (Use absolute path with variable with asset or directly with full path to file)
Read the docs in the files for further details on the usage of the service.
Contributing
ToInlineStyleEmailBundle is an open source project, under MIT license. Contributions are encouraged. Feel free to contribute to improve this bundle.
About the author of the bundle
ToInlineStyleEmailBundle has been originally developed by Roberto Trunfio. Currently, the bundle is mantained by Luis Cordova via the gushphp organization.
The initial package on packagist robertotru was moved here to gushphp organization with the author consent for maintenance.
All versions of to-inline-style-email-bundle with dependencies
symfony/config Version ^5.0 || ^6.0
symfony/dependency-injection Version ^5.0 || ^6.0
symfony/http-kernel Version ^5.0 || ^6.0
symfony/routing Version ^5.0 || ^6.0
tijsverkoyen/css-to-inline-styles Version ^2.2.1
twig/twig Version ^3.0