Another problem: I do not get any error messages, if something goes wrong, e.g. if the subscription id is not found.
I have made this change index.php:
echo $result; //‘FAIL’;
I may have found the culprit for the first problem.
In the original code (index.php, around line 278) the string strEmailConfirmation contains the [email] place holder, which should be replaced the real email value.
I made the following changes and now I get the proper Ajax success message.
Now I get error messages. I found out that subscribelib2.php never returns the value of $msg.
I added return $msg; just before the function ListAvailableLists.
Then I concatenated $success into $result in index.php (around lilne 276):
$success = require ‘admin/subscribelib2.php’;
$result = ob_get_contents() . $success;
I had an outdated strEmailConfirmation string in my finnish.inc. The [email] place holder is removed from the english.inc.
The comment still says: “the EmailConfirmation message can contain placeholders”
The $pagedata[‘thankyoupage’] still contains the non-Ajax confirmation text. This does not matter, because the first part of the condition will be true.
It’s a bit confusing that strEmailConfirmation seems to origin from an inc file and $pagedata[‘thankyoupage’] from the admin side.