定制 mote/email-templater 二次开发

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

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

mote/email-templater

Composer 安装命令:

composer require mote/email-templater

包简介

A PHP email templating library, flexible enough to work with most libraries and frameworks

README 文档

README

Entirely configurable. Can easily be made to work with any email-sending library.

NOTE: This library is still in development, and not fully tested. Should work fine, but you should test it yourself (and submit bug reports or fixes!).

Usage for ZF2:

<?php

use Mote\EmailTemplater as Et;

$templater = new Et\Templater(...);
$transport = new \Zend\Mail\Transport\Sendmail();
try {
    $zendMessage = $templater->fromTemplate(
        'myEmailTemplate',
        array(
            'templateParam1' => 'Something...',
            'templateParam2' => 'Something else...',
        )
    )->convert('zf2'); // Or just ->convert() if "zf2" is set in constructor as default
    $zendMessage->setFrom('admin@localhost')
        ->setTo('someone@somewhere.com');
    $transport->send($zendMessage);
} catch (Et\TemplateNotFoundException $e) {
    echo 'Could not find template';
} catch (Et\Processor\InvalidTemplateException $e) {
    echo 'The template found was invalid';
} catch (Et\Processor\ProcessingException $e) {
    echo 'Generic processing exception';
}

For full example, see example/ folder

TO-DO

  • Have (all) exceptions inherit from a catch-all (match as per ZF2 standards)
  • (Separate) ZF2 module built upon this
  • "@include FILE_NAME" support in JSON to have fields in separate files

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固