prefix.'Appointments'; $userid=$_REQUEST['userid']; $username = $wpdb->get_var("SELECT user_login FROM {$wpdb->users} WHERE ID = '{$userid}'"); get_currentuserinfo(); $user=$current_user->user_login; $admin_email = get_option('email_address'); $lastId = $wpdb->get_var("SELECT max(appointment_id) FROM $table"); // Get last inserted id $res=$wpdb->get_results("SELECT * from $table WHERE appointment_id='".$lastId."'"); foreach($res as $val){ $a=$val->email_id; $dat=$val->date_of_apointment; } $path = $this->options['upload_image']; $img = ""; $subtitle="Hi {$username},"; $subjectPara1 = 'Appointment successfully approved by admin!'; $subjectPara2 = 'Please click here to show approved Appointment.'; $subjectPara3 = 'Thank you'; $message = ''. ''. ''. 'Email notification'. ''. ''. ''. '
'. '
'. '

'.$subtitle.'

'. '

'.$subjectPara1.'

'. '

'.$subjectPara2.'

'. '

'.$subjectPara3.'

'. '
'. '
'. ''. ''; /*EMAIL TEMPLATE ENDS*/ $to = 'me@example.com'; // give to email address $subject = 'Email template sample PHP'; //change subject of email $from = ''; // give from email address // mandatory headers for email message, change if you need something different in your setting. $headers = "From: " . $from . "\r\n"; $headers .= "Reply-To: ". $from . "\r\n"; $headers .= "CC: test@example.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; // Remember, mail function may not work in PHP localhost setup but the email template can be used anywhere like (PHPmailer, swiftmailer, PHPMail classes etc.) // Sending mail ?>