BiologicalRecordsCentre / iRecord

Repository to store and track enhancements, issues and tasks regarding the iRecord website.
http://irecord.org.uk
2 stars 1 forks source link

Question: editing email addresses in the warehouse #944

Open kitenetter opened 3 years ago

kitenetter commented 3 years ago

A user registered with email 1, and subsequently edited their iRecord profile to email 2. They are apparently still getting notifications that go to email 1.

Some questions arise:

  1. I would have thought that changing the email address in your iRecord profile should result in notifications going to the new address - is that not the case? Is there a bug here?
  2. Is there any reason not to edit the email address from email 1 to email 2 in the warehouse People interface? (Email 2 is in use for a separate UKBMS account.)
  3. Should I make any changes to the Identifiers in the warehouse Users interface (currently both email 1 and email 2 are shown as identifiers)?
kitenetter commented 3 years ago

Marking this as urgent as the user is complaining that he is having to pay out for an extra email address simply in order to receive iRecord notifications. Can I just remove the old email from the User identifiers in the warehouse User table, and also update the email in the warehouse People table?

johnvanbreda commented 3 years ago

I think you just need to correct it in the People table. The user_identifiers table will only be used to detect that it's the same person if they use the other email address to register somewhere else.

kitenetter commented 3 years ago

Does that mean that everyone who has ever changed their email address in iRecord is still being sent notifications to their old address? If so it would be good to change the functionality so that if a user edits their email address the new address propogates through the system.

johnvanbreda commented 3 years ago

Yes, that's correct, though it may be an oversimplification. If a user has an account on several websites and apps, should the propogation occur across the websites? What happens if they change it on one then not the others?

Maybe the notifications should go to the last saved email address for that user whichever website it came from. Presumably this is no longer urgent and can be scheduled as normal?

kitenetter commented 3 years ago

It feels logical that notifications relating to records that originate from a particular website should be sent to the current version of the email address that the user has registered on that website, but I'm not sure how easy that is to achieve.

We need to fix this, as it is very unhelpful for notifications to be lost if a user changes their email address. Let's review at the next meeting.

johnvanbreda commented 3 years ago

Ok, we'd need to store the email_address field in the users_websites table so they can have 1 per website. Then we'd just need to make sure the notifications are sent to the correct address, which means limiting a digest email to notifications from a single website. Or being a bit more clever and do a digest email per email address (which means several website notifications can still group together).

kitenetter commented 3 years ago

Sorry @johnvanbreda, I've hit another problem.

I just tried to update the email address in the people table for warehouse user ID 112337. That user ID is linked to websites Earthworm Watch; iRecord; National Plant Monitoring Scheme; TVERC.

However, it would not save, because the new email address has been registered separately for the NFBR website and is linked to user ID 151964, and when I try to use it for user ID 112337 I'm told that the email is not unique.

Is there any way of combining these two accounts so that all notifications go to the new email address?

johnvanbreda commented 3 years ago

@kitenetter There is a people_tidier warehouse module but it is not enabled and hasn't been used, having been written several years ago. I suggest testing it on the devwarehouse first and checking the results before doing the merge on the live warehouse.

johnvanbreda commented 3 years ago

@kitenetter I've reviewed the people tidier module on my local setup and, although I think the code works, it doesn't propagate the changes across the Drupal sites - they will still have the wrong user IDs (unless they've already been corrected).

I think it would be a good idea to document some scenarios and exactly what is expected of the system before using this tool.