I have a php script that generates an email when a button is clicked. The content of the email is in the script. What I need is that when this same button is ticked, if the user is English then the message in the email is in English and if the user is Italian then the message is in Italian. (I will provide both the English and Italian Text.) There is a client database which has a field called language and there is only 2 options possible English and Italian. This gets populated when the users are being added. This is all working fine its just the email generation that I can't get working.
i am attaching the code below:
if(isset($weekly))
{
$message.="Please Click the Link Below to View Report\n\n";
$message.="[login to view URL]";
$query = "select * from customers where subscription='Weekly'";
$result=mysql_query($query) or die("ERROR reading database for Weekly Subscribers! ".mysql_error());
while($row = mysql_fetch_array($result))
{
mail($row['email'], $subject, $message, $headers);
}
}
I will send the full file when I agree a price with someone