THERE IS ALTERNATIVE SOLUTION:
I gave up trying to fix this bug, but I made another very very simple code myself that will do the same thing.
By clicking unsubscribe in email customer will be directed to a page that contains an empty form where he shall
insert his email address and click "Unsubscribe". After that customer will be directed to page of your choice (in
this example UNSUBSCRIBE_COMPLETE.php). For this reason there is java involved. The source code for this page is:
1. Insert inside the end of <HEAD> tags:
<script type="text/javascript">
<!--
function doubleSubmit(f)
{
// submit to action in form
f.submit();
// set second action and submit
f.target="_blank";
f.action="UNSUBSCRIBE_COMPLETE.php";
f.submit();
return false;
}
//-->
</script>
-------------------------------------------------------
2. Insert this DIV to a page where you direct customer from email unsubscribe link
<div>
<form method="POST" onsubmit="doubleSubmit(this)" action="<?php tep_db_query("UPDATE customers SET customers_newsletter = '0' WHERE customers_email_address = '" .$_POST['email'] . "'"); ?>">
<table width="250" border="0" cellspacing="2" cellpadding="0">
<tr>
<td class="bodytext">Email address:</td>
<td><input name="email" type="text" id="email" size="32"></td>
</tr>
<tr>
<td class="bodytext"> </td>
<td align="left" valign="top"><input type="submit" name="Submit" value="Unsubscribe"></td>
</tr>
</table>
</form>
</div>
I hope i have helped someone :)