fullscreeninteractive/silverstripe-postmarkmailer

此包已被弃用且不再维护。作者建议使用jonom/silverstripe-postmark-mailer包。

通过Postmark发送电子邮件的SilverStripe模块

1.0 2016-04-06 22:59 UTC

This package is not auto-updated.

Last update: 2016-04-06 23:00:53 UTC


README

维护者联系方式

  • Will Rossiter

要求

  • SilverStripe 2.3或更高版本。
  • PHP5.3或更高版本以支持入站钩子。

概述

此模块提供了一个用于在SilverStripe项目中使用的Postmark(《http://postmarkapp.com/》)邮件子类。实际上,它是对现有的PHP库的微小包装

- https://github.com/Znarkus/postmark-php.git
- https://github.com/jjaffeux/postmark-inbound-php.git

该模块通过Email::set_mailer();透明地钩入您的SilverStripe安装。

您可以在每个实例或环境的基础上使用set_mailer,以便在生产环境中通过Postmark设置电子邮件,而在开发环境中使用SMTP。

如何使用

  • 注册Postmarkapp(《http://postmarkapp.com》)
  • 通过postmarkapp仪表板创建您的第一个服务器和签名。
  • 在您的SilverStripe项目中定义POSTMARKAPP_API_KEY和POSTMARKAPP_MAIL_FROM_ADDRESS变量。

在您的_config.php中放置以下内容

define('POSTMARKAPP_MAIL_FROM_NAME', 'Your Name');
define('POSTMARKAPP_MAIL_FROM_ADDRESS', 'mailer@yourdomain.com');
define('POSTMARKAPP_API_KEY', '...5aef660..');
  • 设置Mailer为您的SilverStripe Mailer实例,再次,请将其放在_config.php中或需要在发送电子邮件之前添加的代码之前

    Email::set_mailer(new PostmarkMailer());

已知问题

目前我只为从SaaS应用程序发送简单的文本电子邮件而使用此模块,并且没有测试一些其他功能。例如,附加文件,自定义电子邮件(回复,cc)

如果您需要缺少的功能,请进行分支,贡献或联系。

许可

此模块在BSD许可证下发布。Postmark PHP库和Postmark Inbound PHP库均在MIT许可证下发布。

https://open-source.org.cn/licenses/mit-license.php