承接 paulbunyannet/premailer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

paulbunyannet/premailer

最新稳定版本:2.0.0

Composer 安装命令:

composer require paulbunyannet/premailer

包简介

Css inliner for HTML emails

关键字:

README 文档

README

premailer

Inline CSS for use in html emails, uses Dialect Preflight API

install

composer require paulbunyannet/premailer:"^1.0"

Usage

From String

To inline css for a html email from a string:

<?php
require_once 'vendor/autoload.php';

$html = '<html>
        <head>
            <style>
                .paragraph {
                    font-size: 12px;
                }
            </style>
        </head>
        <body>
            <p class="paragraph">Lorem ipsum dolor sit amet, ne sea sumo laudem. Iracundia concludaturque no pro. Ex tempor praesent eos, ea dicta consetetur ius, eligendi posidonium referrentur cum no. Nulla dissentiet vel et, mei at sumo numquam, pro iriure constituam voluptatibus te. Affert fabulas impedit nec an, aeterno partiendo voluptaria duo ne.</p>
        </body>
     </html>';
     
$inlined = Premailer::html($html);         

This will result in the .paragraph class attributes being injected into the paragraph tag it's used in.

From a url

<?php
require_once 'vendor/autoload.php';
$url = 'https://google.com';     
$inlined = Premailer::url($url);

Response

Both responses will return keys "html", the html string with inlined css, and "plain", a plain text version of the html provided, on success or exception on error.

统计信息

  • 总下载量: 10.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-07