It turned out that it was actually working correctly, but since I don’t have a mail server configured on my localhost, phplist was responding: Sorry, sending the message to request your confirmation failed, please click "Reload" to try again. If it still does not work, please contact the administrator.
When I uploaded the code to my server it worked as expected.
So, for anyone else having trouble with this: You need a working mail server in your development environment to test this.
(Which I should have remembered from reading the phplist development guide…)
I have a new problem. I’m now trying to pass additional parameters by they aren’t being recorded.
I enabled the parameter in the subscribirían page in config and its being passed back in the url (I see it in console log)
If a wrong subscription page id is given, phpList will use the default subscription page, which probably is not good for Ajax.
This my change in index.php around line 120:
// make sure the subscribe page still exists
$id_save = $id;
$req = Sql_fetch_row_query(sprintf(‘select id from %s where id = %d’, $tables[‘subscribepage’], $id));
$id = $req[0];
if ($id == null) {
echo sprintf($GLOBALS[‘strSubscriPageMissing’],$id_save);
return;
}
Revisiting this old thread. Just wanted to say thanks for posting your solution, and also to link to our solution. Here’s the html and js (jquery) that we use for users subscribing via an ajax form on one of our domains (in wordpress, mediawiki, etc) without having to visit our actual phplist site:
I got this working, however am disappointed to discover that it does not work on Safari mobile devices…for example in iPhones running Safari. Does anyone have a solution for this?
Correction, I had a small bug in my CSS that was breaking it in Safari, I got it working.
Sorry about all of the posts. Actually there does seem to be an issue with Safari on iPhones when using this form. I can get this working on the desktop with no issues, but have only got it to work sporadically on Safari. Any ideas?
I apologize yf I add a question to a solved post. Shoud I post a new one instead?
I am new here. I read this topic and got the duncanc file and suggestion regarding the FAIL message. Actually Y changed for echo ‘FAIL: |’ . $result . ‘|’;
I went by the ACCESS_CONTROL_ALLOW_ORIGINS and now I don’t have any complain in the browser
The thing using the duncanc sample is that I get always
FAIL: | |
(with a space in between the |)
Reviwing the parameters passed to the index, they are: p=asubscribe&id=3 (the List name in the admin page is “insta” and the List ID is 3=
I changed list[3] to insta and the result is the same. I am not sure which is the correct value. BTW is the third list in the admin panel.
I changed asubscribe to subscribe as well and same result
Checking the index page I noticed calls
and the parameters are (Firefox inspect)
{
“email”: “notuo@XXX.com”,
“attribute1”: “notuo”,
“htmlemail”: “1”,
“list[3]”: “signup”,
“subscribe”: “subscribe”,
“VerificationCodeX”: “”
}
Any idea? I am totally lost
Do you need more info?
Thanks in advance