Editing subscription e-mail address

Bug #238514 reported by Katja Süss
2
Affects Status Importance Assigned to Milestone
Singing & Dancing
Fix Committed
Wishlist
Unassigned

Bug Description

Changing a subscription's e-mail address is not supported at this point. We should implement some event subscriber to maintain consistency with the catalog and index keys (e-mail and secret) when an e-mail address is changed.

description: updated
Changed in singing-dancing:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Wouter Vanden Hove (wouter-wvhconsulting) wrote :

> Changing a subscription's e-mail address is not supported at this point.
Well, users seems to think the opposite. Just discovered a S&D instance where at least tens of users changed their emailadress.

So newsletters were send to the wrong address for x fears it seems.
And when it bounces, you cannot delete the subsciber because it cannot be found, since the old emailaddress is used in the key.

Revision history for this message
Wouter Vanden Hove (wouter-wvhconsulting) wrote :

the event-subscriber is already there:

collective/singing/subscribe.py :
{{{
@component.adapter(collective.singing.interfaces.ISubscription, zope.lifecycleevent.IObjectModifiedEvent)
def subscription_modified(obj, event):
    _catalog_subscription(obj)
}}}

Revision history for this message
Daniel Nouri (daniel.nouri) wrote :

Hey Wouter,

Is it that with a standard installation today you can change email addresses? I thought that this wasn't the case.

In any case, if changing the email address can be supported by using the event subscriber, I'm all for it. Maybe you already have a working implementation for your site? If so, could you maybe send a patch? Thanks.

Revision history for this message
Daniel Nouri (daniel.nouri) wrote :

As discussed at EuroPython, if you need to change email addresses of subscribers, there is now a 'add_subscription_obj' method, which will help you do that (or change any other modification key).

The method is in the trunk of collective.singing (see r250366).

Here's the relevant bit from browser.txt:

Changing a user's email address requires us to remove and add back the
subscription. This can be done by calling 'remove_subscription' and
then 'add_subscription' with the modified subscription object:

  >>> from collective.singing.channel import lookup
  >>> channel = lookup('my-other-channel')
  >>> subscriptions = channel.subscriptions
  >>> subscription = subscriptions['<email address hidden>']
  >>> subscriptions.remove_subscription(subscription)
  >>> subscription.composer_data['email'] = '<email address hidden>'
  >>> subscriptions.add_subscription_obj(subscription)

Changed in singing-dancing:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.