New drupal user does not automatically subscribe to PHPList
| Project: | phplist Integration Module |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | paulbeaney |
| Status: | needs review |
Jump to:
Hi,
I have verion 6.x-1.x-dev of the php integration module. Everything is connecting ok, and for existing users subscribing and unsubscribing to my lists works a treat both ways (on sync).
However, a new user, when added to drupal behaves as follows:
- user is automatically 'subscribed' on registration in drupal (as desired)
- if i then log out and log back in as admin and examine this user in drupal he is indeed subscribed ('unsubcribe' appears next to the mailing list)
- On hitting 'synchronise users' the user appears in phplist, but is NOT subscribed to the list
- The user is now UNSUBSCRIBED in drupal too
Any help would be greatly appreciated.
PS. I know this is a separate issue, but is is possible to sync this eventually using cron?

#1
Hi,
The "Synchronise users" button is only designed to be used ONCE when you first install the PHPlist module on a copy of Drupal with an existing user base. It simply does a bulk sync of all users at that point, hence why there is no cron job.
All subsequent (un)subcription changes within user accounts are automatically fed back to PHPlist without any further intervention on your part. In fact, even if Drupal hasn't been synched with PHPlist, a user can still manage their subscriptions as their record (only) will be synced to PHPlist if it doesn't already exist.
That said, doing a "Sync users" later on *shouldn't* wipe any existing subscriptions - can you confirm whether this is the case please?
Regards,
- Paul
#2
Ok, thanks for the reply. In this case I have TWO problems now :-(
Firstly, the original problem...on the initial synchronisation (done just once at the beginning) any user that has chosen to be subscribed to a mailing list in Drupal does not get subscribed in PHPList. (perhaps it is not designed to do this and only syncs users and not their subscriptions??)
Secondly, any new sign ups on the Drupal side DO NOT automatically get added to PHPList even if they have subscribed to a newsletter (on initial registration, in my test example I selected 2 mailing lists on registration). HOWEVER, if I go back in to that newly created record in Drupal user management and look at 'My Newsletters' I see that drupal has NOT actually signed me up for the second and only the first has 'unsubscribe' ......so I hit 'subscribe' to the second one, and hey presto, a record appears in PHPList. BUT, the problem is PHPList only gets the message to subscribe to the second mailing list, so now both Drupal and PHPList have me NOT SUBSCRIBED to the first list!
Basically it looks like it all works except for something that has happened since I installed PHPList integratot that fails to subscribe you to mailing lists on the initial registration.
Some other useful information: I have user profiles activated but have NO extra fields, it seems to make no difference if I have 'Automatically subscribe users to first listed newsletter' on or off, both newsletters are ticked by default on registration.
Any other help would be greatly appreciated.
Dom
#3
I have completely re-worked the code in hook_user and tweaked _phplist_manage_subscription() in the D6-DEV module. Feel free to download and test.
Regards,
- Paul
#4
A bit related is my problem,
New users should be registered to phplist and then to a particular list. Users are indeed placed in phplist but not assigned to the list mentioned in Drupal. Furthermore, unsubscribing is possible but subscribing not, it wil return the following sentence "You do not have permission to subscribe to this list". This is de case even for the super user and after I have checked that all permissions on the module side and within drupal permissions are set all open.
#5
Hi,
I have just tested this scenario with the latest D6-DEV and it works. Please confirm if the problem still exists for you?
Regards,
- Paul
#6
Slight correction: I have found the bug for auto-subscribing on sign-up and I think it is corrected, although I haven't had time yet to test every single scenario (admin-created account, public-created account requiring admin approval, instantly-activated public-created account...
If someone could take some time to test the different scenarios, that would be most helpful.
Regards,
- Paul
#7
Here is one case that doesn't work.
I registered as a new user on Drupal.
Upon account creation, I get a confirmation message (debug is on) that a user was created in phplist, which is good.
Then I get a Drupal warning: warning: Invalid argument supplied for foreach() in /path_to_root/httpdocs/sites/all/modules/phplist/phplist.module on line 482.
I then login with that user. I can see the list (there is only one) from the My Account tab, but the user hasn't been automatically subscribed to it.
Other functions (synch, subscribe, unsubscribe) work very well.
Regards,
Julien