0

When a customer sends an appointment request the service provider gets an email. I want to include a link in this email, which would trigger an email that would be sent directly to customer.

Following code just opens the blank page in browser when the link in the email is clicked and the email is not sent. What am I doing wrong?

<a href='?confirmation'>Confirm appointment request</a>

<?php
function confirmFunction() {
    $to = $appointment->get_order()->billing_email;
    $subject = 'Appointment confirmed';
    $msg = "Appointment confirmed.\n";
    mail($to, $subject, $msg);
}

if (isset($_GET['confirmation'])) {
    confirmFunction();
}
?>
Uroš Trstenjak
  • 903
  • 8
  • 14

0 Answers0