saskoh/conaktiv-emogrifyplugin
Composer 安装命令:
composer require saskoh/conaktiv-emogrifyplugin
包简介
Inline CSS in HTML using Emogrifier.
关键字:
README 文档
README
Inline CSS in HTML using Emogrifier.
Installation and requirements
Install via composer, using:
composer require saskoh/conaktiv-emogrifyplugin
Requirements:
- PHP 5.6+
- Emogrifier 3.x
Usage
By default, the plugin will inline CSS that is part of the HTML, eg. styles defined in <style> tags.
You can instantiate the plugin with your own Emogrifier instance or change properties of the emogrifier instance.
For a list of options, please head over to the Emogrifier documentation.
Please note, that the plugin is using one instance of Emogrifier to convert all message-parts,
so the settings you make apply to all converted html parts.
Supplying custom CSS
$plugin = new EmogrifierPlugin(); $plugin->getEmogrifier()->setCss('.customStyle: { color: red; };');
Please note: Calling setHtml on the Emogrifier instance doesn't have an effect, since it will be replaced with
the message body!
Example
Here's how you could use the plugin to send emails with custom styles loaded from a file:
$emogrifier = new Pelago\Emogrifier(); $emogrifier->setCss(file_get_contents( /* path to your CSS file */ ));
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-04-07