madj2k / t3-postmaster
发送电子邮件和群发邮件的扩展
Requires
- php: >=7.4
- ext-fileinfo: *
- ext-json: *
- madj2k/t3-accelerator: ~10.4.0 || ~11.5.0 || ~12.4.0
- madj2k/t3-core-extended: ~10.4.0 || ~11.5.0 || ~12.4.0
- typo3/cms-core: ~10.4.0
- voku/bounce-mail-handler: ^5.5
Replaces
- rkw/rkw-mailer: >=9.5.0
- dev-master
- v10.4.0-stable
- v9.5.1002-stable
- v9.5.1001-stable
- v9.5.1000-stable
- v9.5.14-stable
- v9.5.12-stable
- v9.5.11-stable
- v9.5.10-stable
- v9.5.9-stable
- v9.5.8-stable
- v9.5.7-stable
- v9.5.6-stable
- v9.5.5-stable
- v9.5.4-stable
- v9.5.3-stable
- v9.5.2-stable
- v9.5.1-stable
- v9.5.0-stable
- dev-development
- dev-master9.5
This package is auto-updated.
Last update: 2024-09-26 14:46:50 UTC
README
群发邮件发送扩展
特性
- 定时发送
- 通过BE模块获取打开率、点击率和退订率
- 自动检测硬退订
- 个性化群发邮件
- 优化以减少处理负载和数据库空间使用
- 完全兼容fluid-templates
- 多个ViewHelpers
- 用于自定义扩展的通用API
- 包含List-Unsubscribe-Header
- 支持附件
- 高度优化的缓存框架,提高性能
- 多部分电子邮件(纯文本/HTML)
在您的自定义扩展中使用
该扩展包含Mailservice和多个ViewHelpers,可在您的扩展中使用。
您可以在Example-Folder中找到Mailservice的使用示例。您还可以在相应的电子邮件模板中找到ViewHelpers的使用示例。
设置
- 在您的根页面中包含TypoScript
- 在计划任务中设置CLI命令
CLI命令
postmaster:send
该命令负责发送所有电子邮件。参数
- emailsPerJob -> 在一个命令调用中要处理的队列作业数
- emailsPerInterval -> 每个队列作业最多发送多少封电子邮件
- settingsPid -> 获取TypoScript设置的Pid
- sleep -> 在发送每封电子邮件后脚本应休眠的秒数
postmaster:analyseStatistics
该脚本分析已发送电子邮件的统计信息。参数
- daysAfterSendingStarted -> 定义发送开始后多久更新统计信息(默认:30天)
postmaster: cleanup
删除带有或没有对应统计信息的旧电子邮件
- daysAfterSendingFinished -> 定义在发送完成后多少天后队列邮件及其对应的数据将被删除(默认:30天)
- types -> 定义清理应查找的邮件类型(以逗号分隔)(默认:仅类型"0")
- includingStatistics -> 定义是否应删除统计信息(默认:0)
postmaster:analyseBounceMails
处理退订邮件,并将它们的响应数据放入数据库中。
注意:为了能够处理退订邮件,您必须使用POP3/IMAP账户!
参数
- username -> 退订邮件账户的用户名
- password -> 退订邮件账户的密码
- host -> 退订邮件账户的主机
- port -> 退订邮件账户的端口号(默认:143 - IMAP)
- usePop3 -> 使用POP3协议而不是IMAP(默认:0)
- tlsMode -> 退订邮件账户的连接模式(none, tls, notls, ssl等;默认:notls)
- inboxName -> 收件箱的名称(默认:INBOX)
- deleteBefore -> 如果设置,将删除所有在给定日期之前的邮件(格式:yyyy-mm-dd)
- maxEmails -> 要处理的电子邮件的最大数量(默认:100)
postmaster:processBounceMails
通过响应代码处理获取的退订邮件,并将数据库中对应收件人的状态设置为参数
- maxEmails -> 要处理的电子邮件的最大数量(默认:100)
ViewHelpers
cache.renderCache
例如,如果您向大量收件人发送新闻通讯,则通讯中可能包含许多每个收件人相同的相同内容。在这种情况下,您应该缓存内容以提高性能。您还可以向cacheIdentifier添加一个附加字符串,例如,以便区分自定义排序,并且您可以定义非缓存标记。示例
<postmaster:cache.renderCache queueMail="{queueMail}" isPlaintext="true" additionalIdentifier="mySorting">
CONTENT TO CACHE
</postmaster:cache.renderCache>
email.replace.redirectLinks
将所有链接替换为重定向链接,以便跟踪它们进行统计。示例
<postmaster:email.replace.redirectLinks queueMail="{queueMail}" isPlaintext="true">
Testen Sie hier: http://www.google.de
Testen Sie da: [http://www.yahoo.de/#anchor-1]
Testen Sie dort: mail@example.com
Testen Sie überall: #anchor-2
</postmaster:email.replace.redirectLinks>
<postmaster:email.replace.redirectLinks queueMail="{queueMail}" >
<p>
<a href="http://www.google.de">Testen Sie hier</a>
<a href="http://www.yahoo.de/#anchor-1">Testen Sie da</a>
<a href="mailto:mail@example.com">Testen Sie dort</a>
<a href="#anchor-2">Testen Sie überall</a>
</p>
</postmaster:email.replace.redirectLinks>
结果
Testen Sie hier: http://www.example.com/umleitung/postmaster/redirect/1?no_cache=1&tx_postmaster_tracking%5Burl%5D=http%3A%2F%2Fwww.google.de
Testen Sie da: [http://www.example.com/umleitung/postmaster/redirect/1?no_cache=1&tx_postmaster_tracking%5Burl%5D=http%3A%2F%2Fwww.yahoo.de%2F%23anchor-1
Testen Sie dort: mail@example.com
Testen Sie überall: #anchor-2
<p>
<a href="http://www.example.com/umleitung/postmaster/redirect/1?no_cache=1&tx_postmaster_tracking%5Burl%5D=http%3A%2F%2Fwww.google.de">Testen Sie hier</a>
<a href="http://www.example.com/umleitung/postmaster/redirect/1?no_cache=1&tx_postmaster_tracking%5Burl%5D=http%3A%2F%2Fwww.yahoo.de%2F%23anchor-1">Testen Sie da</a>
<a href="mailto:mail@example.com">Testen Sie dort</a>
<a href="#anchor-2">Testen Sie überall</a>
</p>
email.replace.rteLinks
如果您使用来自后端富文本编辑器的文本,您可能希望将RTE链接替换为真实的链接。此视图助手为您完成工作。与旧的和新的RTE链接一起工作。示例
<postmaster:email.replace.rteLinks isPlaintext="true">
Testen Sie hier <link https://www.google.de _blank external-link Titel ist Titel>mit Klick</link>!
Testen Sie da <link http://www.yahoo.de/#anchor-1 _blank external-link "Titel ist Titel">mit Klick</link>!
Testen Sie dort <link mail@example.com _blank mail "Titel ist Titel">mit Klick</link>!
Testen Sie überall <link 9999 _blank tinternal-link "Titel ist Titel">mit Klick</link>!
Testen Sie hüben <link 9999#anchor-1 _blank tinternal-link "Titel ist Titel">mit Klick</link>!
Testen Sie drüben <link file:999 _blank download "Titel ist Titel">mit Klick</link>!
Testen Sie hier <a class="external-link" href="https://www.google.de" target="_blank" title="Test">mit Klick</a>!
Testen Sie da <a class="external-link" href="http://www.yahoo.de/#anchor-1" target="_blank" title="Test">mit Klick</a>!
Testen Sie dort <a class="mail" href="mailto:mail@example.com" title="Test">mit Klick</a>!
Testen Sie überall <a class="internal-link" href="t3://page?uid=9999" title="Test">mit Klick</a>!
Testen Sie hüben <a class="internal-link" href="t3://page?uid=9999#anchor-1" title="Test">mit Klick</a>!
Testen Sie drüben <a class="download" href="t3://file?uid=999" title="Test">mit Klick</a>!
</postmaster:email.replace.rteLinks>
<postmaster:email.replace.rteLinks>
<p>
Testen Sie hier <link http://www.google.de _blank external-link "Titel ist Titel">mit Klick</link>!<br />
Testen Sie da <link http://www.yahoo.de/#anchor-1 _blank external-link "Titel ist Titel">mit Klick</link>!<br />
Testen Sie dort <link mail@example.com _blank mail "Titel ist Titel">mit Klick</link>!<br />
Testen Sie überall <link 9999 _blank internal-link "Titel ist Titel">mit Klick</link>!<br />
Testen Sie hüben <link 9999#anchor-1 _blank internal-link "Titel ist Titel">mit Klick</link>!<br />
Testen Sie drüben <link file:999 _blank download ">Titel ist Titel"mit Klick</link>!
</p>
<p>
Testen Sie hier <a class="external-link" href="https://www.google.de" target="_blank" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie da <a class="external-link" href="http://www.yahoo.de/#anchor-1" target="_blank" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie dort <a class="mail" href="mailto:mail@example.com" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie überall <a class="internal-link" href="t3://page?uid=9999" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie hüben <a class="internal-link" href="t3://page?uid=9999#anchor-1" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie drüben <a class="download" href="t3://file?uid=999" target="_blank" title="Titel ist Titel" style="color:red;">mit Klick</a>!
</p>
</postmaster:email.replace.rteLinks>
结果
Testen Sie hier mit Klick [https://www.google.de]!
Testen Sie da mit Klick [http://www.yahoo.de/#anchor-1]!
Testen Sie dort mit Klick [mailto:mail@example.com]!
Testen Sie überall mit Klick [http://www.example.com/testseite]!
Testen Sie hüben mit Klick [http://www.example.com/testseite#anchor-1]!
Testen Sie drüben mit Klick [http://www.example.com/fileadmin/test.pdf]!
Testen Sie hier mit Klick [https://www.google.de]!
Testen Sie da mit Klick [http://www.yahoo.de/#anchor-1]!
Testen Sie dort mit Klick [mailto:mail@example.com]!
Testen Sie überall mit Klick [http://www.example.com/testseite]!
Testen Sie hüben mit Klick [http://www.example.com/testseite#anchor-1]!
Testen Sie drüben mit Klick [http://www.example.com/fileadmin/test.pdf]!
<p>
Testen Sie hier <a href="http://www.google.de" title="Titel ist Titel" target="_blank" class="external-link">mit Klick</a>!<br />
Testen Sie da <a href="http://www.yahoo.de/#anchor-1" title="Titel ist Titel" target="_blank" class="external-link">mit Klick</a>!<br />
Testen Sie dort <a href="mailto:mail@example.com" title="Titel ist Titel" target="_blank" class="mail">mit Klick</a>!<br />
Testen Sie überall <a href="http://www.example.com/testseite" title="Titel ist Titel" target="_blank" class="internal-link">mit Klick</a>!<br />
Testen Sie hüben <a href="http://www.example.com/testseite#anchor-1" title="Titel ist Titel" target="_blank" class="internal-link">mit Klick</a>!<br />
Testen Sie drüben <a href="http://www.example.com/fileadmin/test.pdf" target="_blank" class="download">Titel ist Titel"mit Klick</a>!
</p>
<p>
Testen Sie hier <a href="https://www.google.de" class="external-link" target="_blank" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie da <a href="http://www.yahoo.de/#anchor-1" class="external-link" target="_blank" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie dort <a href="mailto:mail@example.com" class="mail" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie überall <a href="http://www.example.com/testseite" class="internal-link" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie hüben <a href="http://www.example.com/testseite#anchor-1" class="internal-link" title="Titel ist Titel" style="color:red;">mit Klick</a>!<br />
Testen Sie drüben <a href="http://www.example.com/fileadmin/test.pdf" class="download" target="_blank" title="Titel ist Titel" style="color:red;">mit Klick</a>!
</p>
email.uri.action / email.uri.page / email.uri.typolink
使用此视图助手在发送电子邮件时生成有效的绝对链接。这很重要,因为邮件通过CLI发送。
email.image
在发送电子邮件时渲染图像。这很重要,因为邮件通过CLI发送。
示例
<postmaster:email.image src="EXT:postmaster/Resources/Public/Images/logo.png" width="536" height="200c" />
email.pixelcounter
此视图助手向您的电子邮件添加一个计数像素,以便能够跟踪它是否已被打开。可以通过电子邮件、收件人或两者来跟踪打开。
<postmaster:email.pixelCounter queueMail="{queueMail}" />
email.plaintextLineBreaks
当使用模板文件定义多部分电子邮件的纯文本部分时,可能会非常讨厌,您为提高模板的可读性而使用的每个缩进或换行符也会显示在最终电子邮件的纯文本部分中。
此视图助手通过删除所有换行符和缩进来解决这个问题。要手动添加换行符,请只需使用\n
。示例
<postmaster:email.plaintextLineBreaks>With line break,
remove line break and indent and\nadd manual line break.</postmaster:email.plaintextLineBreaks>
结果
With line break, remove line break and indent and
add manual line break.
email.recipientSalutation
此视图助手为您的电子邮件收件人生成适当的问候。
示例
<postmaster:email.recipientSalutation queueRecipient="{queueRecipient}" prependText="Hello " appendText=" M. Sc." fallbackText="Hello" />
结果
Hello Mr. Dr. Schmidt M. Sc.
当从rkw_mailer迁移到postmaster时
在通过后端检查数据库表和字段之前,执行以下MySQL查询!
RENAME TABLE `tx_rkwmailer_domain_model_queuemail` TO `tx_postmaster_domain_model_queuemail`;
RENAME TABLE `tx_rkwmailer_domain_model_queuerecipient` TO `tx_postmaster_domain_model_queuerecipient`;
RENAME TABLE `tx_rkwmailer_domain_model_mailingstatistics` TO `tx_postmaster_domain_model_mailingstatistics`;
RENAME TABLE `tx_rkwmailer_domain_model_clickstatistics` TO `tx_postmaster_domain_model_clickstatistics`;
RENAME TABLE `tx_rkwmailer_domain_model_openingstatistics` TO `tx_postmaster_domain_model_openingstatistics`;
RENAME TABLE `tx_rkwmailer_domain_model_bouncemail` TO `tx_postmaster_domain_model_bouncemail`;
RENAME TABLE `tx_rkwmailer_domain_model_openingstatistics` TO `tx_postmaster_domain_model_openingstatistics`;
UPDATE tt_content SET list_type = "postmaster_tracking" WHERE list_type = "rkwmailer_rkwmailer";