定制 1985apps/inline-email 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

1985apps/inline-email

Composer 安装命令:

composer require 1985apps/inline-email

包简介

README 文档

README

A Simple PHP library to generate HTML files with inline css while still using classes while writing the markup. Primarily focused on being able to create simple HTML email content

Installation

Composer

$ composer require 1985apps/inline-email:dev-master

$ "requries" : {
    "1985apps/inline-email": "dev-master"
}

Usage

Composer

require_once "vendor/autoload.php";
$i = new InlineEmail\InlineEmail("<path/to/style.php>");

Without Composer

require_once "path/to/src/InlineEmail/InlineEmail.php";
$i = new InlineEmail\InlineEmail("<path/to/style.php>");

Files and configuration

There are 2 files that need to be setup

  • mail.php - File which contains the HTML
  • style.php - File which contains the CSS styling

mail.php

This file should contain the HTML structure that you want generated

<?
    require_once "vendor/autoload.php";
    $i = InlineEmail\InlineEmail("./style.php");
?>
<div <?= $i->style(["email-container"] ?>>
    <div <?= $i->style(["bold", "red", "font-size: 12px"]) ?>>I am bold, red and 12</div>
</div>

style.php

This file should return a associative array of classnames to css specifications

<?
return [
    "bold" => "font-weight: bold",
    "red" => "color: red",
    "box" => "border: 1px solid red"
];

Generate HTML

Run the below command to generate a HTML file

$ php mail.php > mail.html

Generates

<div style="max-width: 600px">
    <div style="font-weight: bold; color: red; font-size: 12px">I am bold, red and 12
</div>

defaults.style.php

inline-email is shipped with a few standard default css classes. They are found in src/InlineEmail/defaults.style.php

Thats it ! And we love pull requests :) Feel free to improve on our library and we will be happy to merge it into master.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固