I have a script that sends a newsletter, at that moment I get a .php page from
file_get_contents('news.php')
In the news.php page I tried to get the variable using this:
$email = $_REQUEST['email'];
On this page news.php I created a link below the document where the user can register for the newsletter, but I am not able to retrieve the value of the email to pass as a parameter, my the page link news. php looks like this:
Para cancelar o recebimento deste boletim, <a href="http://www.moveissaobento.com.br/unsubscribe.php?e=<?php echo $email ?>"> Clique aqui </a> e vamos removê-lo da lista imediatamente.
The script that sends the news looks like this:
while($row = $result->fetch_array()) {
$id = $row['id'];
$email = $row['email'];
$mail->setFrom('[email protected]', 'Newsletter');
$mail->addAddress($email);
$mail->Subject = 'Envio Newsletter';
$mail->msgHTML(file_get_contents('news.php'), dirname(__FILE__));
$mail->send();
$mail->ClearAddresses();
$stmt = $mysqli->prepare("UPDATE newsletter SET enviado = 1 WHERE id = $id");
$stmt->execute();
}
I could not see a solution.