Plone:通知用户删除其帐户

Plone:通知用户删除其帐户,plone,plone-4.x,Plone,Plone 4.x,在IPrincipalDeletedEvent上使用订户不是解决方案,因为该用户已被删除,我无法获取他的电子邮件地址 <subscriber for="* Products.PluggableAuthService.interfaces.events.IPrincipalDeletedEvent" handler="mycontent.userDeleted" /> 调用myuserDeleted(user\u id,event)时,api.user.get(us

在IPrincipalDeletedEvent上使用订户不是解决方案,因为该用户已被删除,我无法获取他的电子邮件地址

<subscriber
   for="* Products.PluggableAuthService.interfaces.events.IPrincipalDeletedEvent"
   handler="mycontent.userDeleted" />

调用my
userDeleted(user\u id,event)
时,
api.user.get(userid=user\u id)
为无

似乎为已删除的用户添加内容规则也是一样的


当用户的帐户被标记为删除时,您知道如何获取其电子邮件地址吗?我只想给他发送一封电子邮件:您的帐户已按您的请求删除。

在用户被删除之前添加事件的Monkey patching:

patches.zcml
中:

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:monkey="http://namespaces.plone.org/monkey"
           xmlns:zcml="http://namespaces.zope.org/zcml"
           i18n_domain="myapp">

    <include package="collective.monkeypatcher" />
    <include package="collective.monkeypatcher" file="meta.zcml" />


    <monkey:patch description="Add PrincipalBeforeDeleted event"
                  class="Products.PlonePAS.pas"
                  original="_doDelUser"
                  replacement="mycontent.patches._doDelUser"
                  docstringWarning="true" />
</configure>
<subscriber
    for="* mycontent.patches.IPrincipalBeforeDeletedEvent"
    handler="mycontent.globalhandlers.userBeforeDeleted" />
然后添加了此事件的订阅服务器:

configure.zcml
中:

<configure xmlns="http://namespaces.zope.org/zope"
           xmlns:monkey="http://namespaces.plone.org/monkey"
           xmlns:zcml="http://namespaces.zope.org/zcml"
           i18n_domain="myapp">

    <include package="collective.monkeypatcher" />
    <include package="collective.monkeypatcher" file="meta.zcml" />


    <monkey:patch description="Add PrincipalBeforeDeleted event"
                  class="Products.PlonePAS.pas"
                  original="_doDelUser"
                  replacement="mycontent.patches._doDelUser"
                  docstringWarning="true" />
</configure>
<subscriber
    for="* mycontent.patches.IPrincipalBeforeDeletedEvent"
    handler="mycontent.globalhandlers.userBeforeDeleted" />

如果这次活动也能在core举办,那就太好了。也许你可以创建一个公关,直接添加这个?@Tango先生,好主意。我刚开始做一个。(由于这是我在普隆的第一次公关活动,所以需要采取一些措施……)