Is it possible to subscribe to specific list from subscription page through AJAX?


I have created a subscribe page in phplist that offers users an ability to sign up for 3 different lists (at the moment, there might be more in the future).

I’ve also created a landing page on my website with an AJAX form that is meant to promote one of the lists from above and allow users to subscribe only to that one specific list. I’ve based my AJAX form on this wiki here:

The code is working, the users are subscribing properly from my landing page BUT there’s one problem. Even though the specific list ID seems to be defined in the AJAX form code, the users are still being subscribed to all 3 lists at once. Why?

Is this the limitation of AJAX subscription? Or can I somehow define specific list ID in the AJAX form so the users will sign up only for one specific list?

I know that I can make a workaround and create a separate “subscribe page” in phplist and check only that 1 list there and use it for AJAX form. But this raises another problem: when user tries to access his preferences page, he’s tied to the last subscribe page he used. So if he first signed up for list #1 and #2 from the traditional subscription page that offers all 3 lists and THEN he would sign up for list #3 through my landing page with AJAX form tied to different subscribe page that only offers list #3, then on his preferences page he’s going to see only that list #3. He won’t see the list #1 and #2 from other subscribe page and won’t be able to manually uncheck the previous lists. That’s why I want to have only 1 subscription page and just control with the AJAX Form to which list the user will be assigned. Is it possible?

@blazej I have raised this as an issue on Github and it looks like some sort of change will be made.

If you can wait until the change is decided then you can modify your ajax form and index.php accordingly.

Or you could try using the subscribe page, instead of asubscribe. That will return an html page,which you could ignore assuming that the subscription was successful.


Hey Duncan,

First of all, thank you! I really appreciate the help.
When the feature is implemented, I’ll adjust the AJAX form accordingly to support new, proper implementation.

At the moment I made a small workaround. I created a new subscribe page for each AJAX form I have. So right now I have three subscribe pages - the first one (subscribe page id = 1) offers the choice of all lists (#1, #2, #3) and the two remaining pages are tied only to specific list (one page for list #2, other page for list #3) for AJAX purposes.

I’ve connected the AJAX form with specific subscribe pages, so people are subscribing only to specific list.

As for unsubscribing, I’ve modified everywhere the link to [PREFERENCESURL] - I turned it into “[PREFERENCESURL]&id=1”. When the user clicks the link, he gets the preferences page from subscribe page #1 that contains all the lists, so he can see all the lists, regardless how he subscribed, and uncheck the ones he doesn’t want :slight_smile:

A bit of a mess with too many pages, but oh well, for the time being it will be fine and I’ll switch it to proper implementation once it’s out.

Again, thanks for raising my issue on GitHub and take care!

Since this is listed as merged and it’s been a while, is this usable with
I tried the last days and I didn’t have any success.

One thing I saw is, that my form did relocate me to the subscription page of phpList and it seems like the GET parameters are needed in a different way than the POST parameter should be for the AJAX submission.

The lists of phpLists subscription form will be checked if the receive a query parameter of for example:
While the server expects:

I think standard Ajax form suggested by phpList does relocate if something fails. In that case it would be good if it would be compatible.

Did anyone succeed in implementing an Ajax subscription form with the possibility to select one or multiple lists? (That would run with

I’m not exactly sure right now because it doesn’t even send the confirmation mail from the standard form (I get the notification that it couldn’t be sent but the e-mail is listed as unconfirmed subscriber). Either I tried too much and blacklisted myself somehow at phpList or there is some other problem. I probably need a pause and look at it again :>. So there is a slight chance I succeeded myself but wasn’t able to see it so far.

@Znrl That change was in release 3.5.8, so you need to see which release has installed.

Yes I was searching for that, I never saw this anywhere. But thanks to that link there is a URL parameter, that say 3.5.5, so that would mean it sadly is an older version. :frowning:

I decided for a workaround. I used an attribute, in my case radio buttons. These are the categories subscribers can choose and I will move the subscribers manually into the right lists. This works with the Ajax form and I will hope that phpList hosted will update at some point and I can switch to using lists directly.