I am sending a mail after user submits form to approve are disapprove the data through link in mail. Here is the code:
$subject = 'User needs approval';
$message = 'The user $empname needs your approval' .
'----------------------------------- ' . "\r\n" .
'Accept: ' . $accept_link . "\r\n" .
'Decline: ' . $decline_link . "\r\n";
$_headers = 'From:admin@yourwebsite.com' . "\r\n"; // Set FROM headers
//mail($supemail, $subject, $message, $headers); // Send the email
fnMail($supemail,"mailb@mail.com"," Web master","reimbursement Form",$message);
The link to accept and decline is:
$accept_link = "http://communique/elegant-contact-form/quick-contact/ajax/approval.php?e=" . $empemail . "&h=" . hash('sha512', 'ACCEPT');
$decline_link = "http://communique/elegant-contact-form/quick-contact/ajax/approval.php?e=" . $empemail . "&h=" . hash('sha512', 'DECLINE');
and here is the approval.php file:
$hash = $_GET['h'];
$email = $_GET['e'];
if($hash == hash('sha512', 'ACCEPT')){
$res=execQuery('oth','update form set approved=1 where empemail="$email"');
if(count($res)>0){
fnMail($email,"mk.web@mattsenkumar.com","MattsenKumar Web master","Contact Front registration",'APPROVED');
}
}else if($hash == hash('sha512', 'DECLINE')){
fnMail($email,"mk.web@mattsenkumar.com","MattsenKumar Web master","Contact Front registration",'DECLINE');
}
But I got the mail like this:
The user $empname needs your approval----------------------------------- Accept: Decline: