Issue with nspro_user_integration plugin when user changes their email

More
9 months 1 day ago #1 by Craig
NSPro is an excellent tool and meets our requirements for sending out newsletters to club members very well. It has resolved the challenge we had of keeping subscribers inline with the club membership.  To do this we make use of the nspro_user_integration plugin to synchronise subscribers with the Joomla user base. However, in my testing I have found a couple of flaws relating to when a user's profile is changed:
  • If the user changes their name, the change is not reflected in the associated NSPro subscription.
    • not too worried on this, its a rare event 
  • If the user changes their email address, then a second NSPro subscriber is created and the old one left untouched.
    • This is my main concern
I did some investigations and coded a fix for the two issues above that I would like to offer for consideration in a future release of the plugin.

The code change is to the file ~/plugins/user/nspro_user_integration/nspro_user_integration.php which is attached to this report.  The approach uses the Plugin/Events/User::onUserBeforeSave() callback to check for changes in the profile name or email values and remembers the old email address for later use in onUserAfterSave() to first update a subscriber record that has the old email address with the new email and name fields before it does any more processing.  This seems to work fine for my usage but I am conscious that I am only using part of the functionality of the NSPro component, for example we are not currently exposing subscribe/unsubscribe to end users and we are not using event triggered sends of newsletters (ie they are all manual or scheduled).   So not sure if there is any unwanted side effect from this change.

We are using
NS Pro version 3.3.3044
Joomla version 5.3.3
PSP 8.3.24

Please Log in or Create an account to join the conversation.

  • Christopher Mavros
  • Christopher Mavros's Avatar
  • Offline
  • Administrator
  • Administrator
More
9 months 1 day ago #2 by Christopher Mavros
Hi Craig and thank you very much for sharing this feature!
I have included it as an option for backwards compatibility and updated your code a little bit to respect the option choice.
Can you please install the attached and let me know if it still works like you want it to?
Remember that you will need to update your plugin's options to select "Replace old email address" instead of "Maintain both".

Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

More
9 months 1 day ago #3 by Craig
Hi Christopher,  yes I just installed the new version of the user integration plugin you attached and it is working just great for me. Many thanks for adopting the request.

Please Log in or Create an account to join the conversation.

  • Christopher Mavros
  • Christopher Mavros's Avatar
  • Offline
  • Administrator
  • Administrator
More
9 months 1 day ago #4 by Christopher Mavros
Thank YOU for your contribution!

This version of the plugin will be included in the next release.

Let me know if anything else comes up!

Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

Moderators: Christopher Mavros