formatd/mailer

Neos Flow 项目中 Swiftmailer 的包装器

安装次数: 6,718

依赖项: 1

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 1

公开问题: 2

类型:neos-package

v1.1.11 2023-11-14 08:14 UTC

This package is auto-updated.

Last update: 2024-09-14 10:09:49 UTC


README

Neos Flow 或/和 CMS 项目的模板邮件发送器。

它做了什么?

此包提供了一个服务类,旨在用作发送融合模板邮件的基础类。此外,它还包含一个调试方面,用于在开发环境中截获和/或重定向所有邮件(由 Swiftmailer 发送)。

兼容性

版本策略

 1.0.0 
 | | |
 | | Bugfix Releases (non breaking)
 | Neos Compatibility Releases (non breaking except framework dependencies)
 Feature Releases (breaking)

版本和兼容性

在您自己的插件中使用服务以使用邮件的流体模板

配置默认发件人地址

FormatD:
  Mailer:
    defaultFrom:
      address: 'example@example.com'
      name: 'Example'

扩展 AbstractMailerService 并添加所需的方法,按照 sendTestMail() 的示例。

在开发环境中截获所有邮件

配置 Swiftmailer 以截获您的 Neos 安装发送的所有邮件(而不仅限于服务)。

以下是一个示例,截获所有邮件并将它们重定向到 example@example.comsecondexample@example.com

FormatD:
  Mailer:
    interceptAll:
      active: true
      recipients: ['example@example.com', 'secondexample@example.com']
    bccAll:
      active: false
      recipients: []

处理嵌入图像

方法 AbstractMailerService->setMailContentFromStandaloneView() 有一个参数可以嵌入所有图像到邮件正文中。如果您安装受 .htaccess 文件保护,或者用户在阅读邮件时可能无法访问互联网,这很有用。GMail 也不能显示来自本地域的图像。

FormatD.Mailer 可以配置为将所有图像 URL 替换为本地路径(如果您的 flow 配置中指定了 baseUrl)。如果服务器无法向自己发起 Web 请求(可能由于 .htaccess 或其他原因),则需要这样做。

FormatD:
  Mailer:
    localEmbed: true

禁用特定图像的嵌入

您可以通过将 data-fdmailer-embed="disable" 添加到图像标签的数据属性来禁用特定图像的嵌入。如果您不想在本地嵌入跟踪像素,这很有用。