多次通知自定义事件以发送电子邮件不起作用

Notify multiple times custom event to send email not working

具有 obj = modifiedSendNotificationEvent 自定义事件的对象 我正在尝试通知自定义事件,例如:

for email in emails:
    notify(SendNotificationEvent(obj, email))

我有一个带有发送电子邮件操作的自定义内容规则,该规则在 SendNotificationEvent 上发送消息。

问题是发送了一条消息。第一个。 通知似乎只工作了一次。您知道如何调查和解决此问题吗?

我已经在此处尝试使用调试器,似乎我可以通知其他对象的事件并发送电子邮件,但对于每个不同的对象,只有一个,然后什么也没有发生。

This commit was very useful。 (感谢 David,感谢您的精彩描述!感谢您 GitHub 的搜索功能。)

所以,解决方案是:

from plone.app.contentrules.handlers import close

for email in emails:
    evt = SendNotificationEvent(obj, email)
    notify(evt)
    close(evt)  # make sure it will work for multiple notify(