承接 quartzy/php-email 相关项目开发

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

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

quartzy/php-email

最新稳定版本:0.6.0

Composer 安装命令:

composer require quartzy/php-email

包简介

A domain model for describing emails that is indifferent towards sending methods.

README 文档

README

Latest Version on Packagist Total Downloads Software License Build Status Coverage Status Style Status Scrutinizer Code Quality

This is a domain-driven library for defining emails in PHP.

Php Email brings three major benefits over other similar libraries:

  1. Focusing on new versions of PHP. By using the newer versions of PHP (5.6+) we can leverage great features such as splat parameters and better type hinting.
  2. Focusing on only the email, instead of transmission. In a domain-driven world, emails can and should exist separately from the delivery mechanism. By separating these concerns, this library decreases the size and complexity of the domain, while giving developers greater flexibility in how they use the library.
  3. Flexible content definitions. Emails have gone from a simple text string to highly stylized HTML to now just being templates stored in third-party services. Existing libraries do not provide enough flexibility to support everything developers need. Php Email attempts to correct this by creating guidelines for possible email content, but also allowing developers to define what they need.

Install

With Composer

composer require quartzy/php-email

Usage

Building an email with HTML and text content would look like:

<?php

use PhpEmail\Attachment\FileAttachment;
use PhpEmail\EmailBuilder;
use PhpEmail\Content\SimpleContent;

$email = EmailBuilder::email()
    ->withSubject('Welcome!')
    ->withContent(SimpleContent::text('Start your free trial now!!!'))
    ->from('me@test.com')
    ->to('you@yourbusiness.com')
    ->cc('cc@test.com')
    ->bcc('bcc@test.com')
    ->replyTo('reply.to@test.com')
    ->attach(new FileAttachment('/path/to/my/file.txt'))
    ->build();

Sending a templated email:

<?php

use PhpEmail\EmailBuilder;
use PhpEmail\Content\TemplatedContent;

$content = new TemplatedContent('my_templates_id', ['firstName' => 'Billy']);

$email = EmailBuilder::email()
    ->withSubject('Welcome!')
    ->withContent($content)
    ->from('me@test.com')
    ->to('you@yourbusiness.com')
    ->build();

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email opensource@quartzy.com instead of using the issue tracker.

Credits

License

The Apache License, v2.0. Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固