定制 nowise/uup-mail 二次开发

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

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

nowise/uup-mail

Composer 安装命令:

composer require nowise/uup-mail

包简介

Object oriented mail message composer for sending multipart (HTML/plain text) messages optionally formatted using templates (for HTML and plain text layout).

README 文档

README

The uup-mail library provides a mail template and composer library for formatting mail messages. Its main focus is on MIME message composition and layout using templates. The actual sending (transport) of the SMTP message is delegated to other libraries, currently Swift Mailer, PEAR Mail or PHPMailer is supported.

Design

This library was designed with inheritance in mind. Create your own mail message classes (one for each particular kind of message) derived from class MessageComposer:

class ConfirmSubscriptionMessage extends MessageComposer
{
    public function __construct()
    {
        parent::__construct(_("Confirm Subscription", _("...")));
        // ... create additional section headers with content.
    }

    public function setSubscription($id) 
    {
        parent::setContent('Subscription', Subscription::get($id));
    }
}

$composer = new ConfirmSubscriptionMessage();
$message  = new SwiftMessage($composer, $formatter);
$mailer->send($message);

Usage

The library can be used at three different levels:

  1. Use UUP\Mail\Compose only. The library is used solely for message composition.

  2. Use i.e. UUP\Mail\Swift. This is the intermediate level were you can take advantage of the message composition and layout, while still have native access to the Swift Mailer library too.

  3. Use UUP\Mail and its interface. The programming at this level is done against the interfaces (Message and MessageMailer) using the MessageService as a proxy against your code and the native implementation, i.e. Swift Mailer.

A good example of real world usage can be found in example/realistic.php

More

More information can be found on the project page

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-01-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固