Adding new users

Is there a way to add a user using a URL with variables in it. What we want to do is when someone registers at our main site, they would also be added to the phplist database automatically. Possible without using the phplist register form?

@musicweb using the asubscribe page should work or if you need a more comprehensive way to manage subscribers then the rest-api plugin.

To use asubscribe you need to have a subscribe page that meets the restrictions for using ajax as described in the documentation https://www.phplist.org/manual/books/phplist-manual/page/creating-a-subscribe-page#bkmrk-add-an-ajax-subscrib
then you can simply use a URL of this format

https://mysite.com/lists/?p=asubscribe&id=99&email=xxx@yy.com

where id is the subscribe page id, not the list id
also you might need to urlencode the @ character in an email address as %40

If successful then the response is the text configured on the subscribe page within phplist , “Text to display when subscription with an AJAX request was successful”, or FAIL if the subscribe did not work.

Thanks Duncan, I’ll try your suggestions… stay well…

@musicweb Also, the subscriber will still be sent the “confirmation request” email, which might not be what you want if they have already registered on your main web site.

I don’t see the rest-api plugin in the Manage Plugins page. I see the deprecated one in the repository, but it says the newer rest-api is included in the new version of phplist.

Update: I used the link from the Download button and it installed ok

@musicweb The “deprecated” plugin provides greater functionality than the phpList 4 core/REST API that is included with phplist, but both will let you add a user, and make them confirmed.

1 Like