承接 markguinn/silverstripe-email-helpers 相关项目开发

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

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

markguinn/silverstripe-email-helpers

Composer 安装命令:

composer require markguinn/silverstripe-email-helpers

包简介

Silverstripe extension containing SMTP mailer class and some other classes for HTML emails

README 文档

README

Build Status

Contains replacement Mailer object that utilizes PHPMailer to send e-mail via SMTP instead of php's mail() function. Optionally, TLS can be enabled for secure communication with the SMTP server and a charset for the e-mail encoding can be specified. In addition, embedded CSS, plus a specified external CSS file, can be inlined into the email's HTML.

Also includes a drop-in replacement for the Email class called StyledHtmlEmail. If used with HTML emails it allows you to include a style section at the top of the email which will then be inlined as style attributes on the actual html tags to promote better compatibility across email clients.

Requirements

Silverstripe 3.0+

Installation

Install via composer:

composer require markguinn/silverstripe-email-helpers:dev-master

This module installs PHPMailer and Emogrifier:

Usage

SMTP Mailer

To use the SMTP mailer add the following code to your _config.php:

$encryption = 'tls'; // use tls
$charset = 'UTF-8'; // use specified charset if set
// you can specify a port as in 'yourserver.com:587'
$mailer = new SmtpMailer('yourserver.com', 'username', 'password', $encryption, $charset);
Email::set_mailer($mailer);  // or Injector::inst()->registerService($mailer, 'Mailer');

Alternatively, any of these can be set using the config system like so:

SmtpMailer:
  host: yourserver.com
  user: username
  password: password
  encryption: tls
  charset: UTF-8

And then in _config.php:

Email::set_mailer( new SmtpMailer() );

Emogrified Smtp Mailer

If you wish to embed CSS into your email's HTML then use the EmogrifiedSmtpMailer class. Add the following code to your _config.php:

$encryption = 'ssl'; // use ssl
$charset = 'UTF-8';
$externalcssfile = 'themes/{yourtheme}/css/externalcssfile.css';  // specify the path to your css file
$SMTPDebug = 2;  // Levels 0-4 available
$logfailedemail = true;  // Log a notice with PHPMailer's error information
$mailer = new EmogrifiedSmtpMailer('yourserver.com', 'username', 'password', $encryption, $charset, $externalcssfile, $SMTPDebug, $logfailedemail);
Email::set_mailer($mailer);  // or Injector::inst()->registerService($mailer, 'Mailer');

Alternatively, any of these can be set using the config system like so:

EmogrifiedSmtpMailer:
  host: yourserver.com
  user: username
  password: password
  encryption: ssl
  charset: UTF-8
  cssfile: 'themes/{yourtheme}/css/externalcssfile.css'
  SMTPDebug: 2
  logfailedemail: true

And then in _config.php:

Email::set_mailer( new EmogrifiedSmtpMailer() );

Styled Html Email

To use the styled email, just literally use the StyledHtmlEmail class where you'd normally use the Email class and add a single style tag in the body of the email. For example:

<style type="text/css">
.bigred {
	color: red;
	font-size: 30px;
}
</style>
Hello <span class="bigred">CUSTOMERS</span>.

Would be sent as:

Hello <span style="color:red; font-size:30px">CUSTOMERS</span>.

markguinn/silverstripe-email-helpers 适用场景与选型建议

markguinn/silverstripe-email-helpers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 45.67k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2013 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「email」 「smtp」 「silverstripe」 「emogrifier」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 markguinn/silverstripe-email-helpers 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 markguinn/silverstripe-email-helpers 我们能提供哪些服务?
定制开发 / 二次开发

基于 markguinn/silverstripe-email-helpers 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 31
  • Watchers: 6
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-01-15