Arctic Tails, LLC New Customer Boarding Request

Error/Status message is displayed below Submit button

* Required

Owner Information

Veterinarian Information

Boarding information

Pet Information

"; $name=$_POST['name']; $message .= "Name:" . $name; $message .= "
"; $address=$_POST['address']; $message .= "Address:" . $address; $message .= "
"; $phone=$_POST['phone']; $message .= "Phone:" . $phone; $message .= "
"; $email=$_POST['email']; $message .= "Email:" . $email; $message .= "
"; $message .= "*****Veterinarian Information*****"; $message .= "
"; $veterinarian=$_POST['veterinarian']; $message .= "Veterinarian:" . $veterinarian; $message .= "
"; $message .= "*****Boarding Information*****"; $message .= "
"; $startBoardingDate=$_POST['startBoardingDate']; $message .= "Start Boarding Date:" . $startBoardingDate; $message .= "
"; $endBoardingDate=$_POST['endBoardingDate']; $message .= "End Boarding Date:" . $endBoardingDate; $message .= "
"; $addlInfo=$_POST['addlInfo']; $message .= "Addl Info:" . $addlInfo; $message .= "
"; $message .= "*****Pet Information*****"; $petCount=$_POST['petCount']; if ($petCount >= 1) { $message .= "
"; $petName1=$_POST['petName1']; $message .= "Pet Name:" . $petName1; $message .= "
"; $breed1=$_POST['breed1']; $message .= "Breed:" . $breed1; $message .= "
"; $color1=$_POST['color1']; $message .= "Color:" . $color1; $message .= "
"; $gender1=$_POST['gender1']; $message .= "Gender:" . $gender1; $message .= "
"; $birthDate1=$_POST['birthDate1']; $message .= "Birth Date:" . $birthDate1; $message .= "
"; $spayedNeutered1=$_POST['spayedNeutered1']; $message .= "Spayed or Neutered:" . $spayedNeutered1; } if ($petCount >= 2) { $message .= "
"; $petName2=$_POST['petName2']; $message .= "Pet Name:" . $petName2; $message .= "
"; $breed2=$_POST['breed2']; $message .= "Breed:" . $breed2; $message .= "
"; $color2=$_POST['color2']; $message .= "Color:" . $color2; $message .= "
"; $gender2=$_POST['gender2']; $message .= "Gender:" . $gender2; $message .= "
"; $birthDate2=$_POST['birthDate2']; $message .= "Birth Date:" . $birthDate2; $message .= "
"; $spayedNeutered2=$_POST['spayedNeutered2']; $message .= "Spayed or Neutered:" . $spayedNeutered2; } if ($petCount >= 3) { $message .= "
"; $petName3=$_POST['petName3']; $message .= "Pet Name:" . $petName3; $message .= "
"; $breed3=$_POST['breed3']; $message .= "Breed:" . $breed3; $message .= "
"; $color3=$_POST['color3']; $message .= "Color:" . $color3; $message .= "
"; $gender3=$_POST['gender3']; $message .= "Gender:" . $gender3; $message .= "
"; $birthDate3=$_POST['birthDate3']; $message .= "Birth Date:" . $birthDate3; $message .= "
"; $spayedNeutered3=$_POST['spayedNeutered3']; $message .= "Spayed or Neutered:" . $spayedNeutered3; } if ($petCount >= 4) { $message .= "
"; $petName4=$_POST['petName4']; $message .= "Pet Name:" . $petName4; $message .= "
"; $breed4=$_POST['breed4']; $message .= "Breed:" . $breed4; $message .= "
"; $color4=$_POST['color4']; $message .= "Color:" . $color4; $message .= "
"; $gender4=$_POST['gender4']; $message .= "Gender:" . $gender4; $message .= "
"; $birthDate4=$_POST['birthDate4']; $message .= "Birth Date:" . $birthDate4; $message .= "
"; $spayedNeutered4=$_POST['spayedNeutered4']; $message .= "Spayed or Neutered:" . $spayedNeutered4; } if ($petCount >= 5) { $message .= "
"; $petName5=$_POST['petName5']; $message .= "Pet Name:" . $petName5; $message .= "
"; $breed5=$_POST['breed5']; $message .= "Breed:" . $breed5; $message .= "
"; $color5=$_POST['color5']; $message .= "Color:" . $color5; $message .= "
"; $gender5=$_POST['gender5']; $message .= "Gender:" . $gender5; $message .= "
"; $birthDate5=$_POST['birthDate5']; $message .= "Birth Date:" . $birthDate5; $message .= "
"; $spayedNeutered5=$_POST['spayedNeutered5']; $message .= "Spayed or Neutered:" . $spayedNeutered5; } if ($petCount >= 6) { $message .= "
"; $petName6=$_POST['petName6']; $message .= "Pet Name:" . $petName6; $message .= "
"; $breed6=$_POST['breed6']; $message .= "Breed:" . $breed6; $message .= "
"; $color6=$_POST['color6']; $message .= "Color:" . $color6; $message .= "
"; $gender6=$_POST['gender6']; $message .= "Gender:" . $gender6; $message .= "
"; $birthDate6=$_POST['birthDate6']; $message .= "Birth Date:" . $birthDate6; $message .= "
"; $spayedNeutered6=$_POST['spayedNeutered6']; $message .= "Spayed or Neutered:" . $spayedNeutered6; } $subject="New Customer Boarding Request"; $from = new SendGrid\Email($name, $email); $to = new SendGrid\Email("Arctic Tails", "arctictails.info@gmail.com"); // $to = new SendGrid\Email("Arctic Tails", "w.soon800@gmail.com"); $content = new SendGrid\Content("text/html", $message); $mail = new SendGrid\Mail($from, $subject, $to, $content); $apiKey = "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"; $sg = new \SendGrid($apiKey); $response = $sg->client->mail()->send()->post($mail); if ($response->statusCode()=="202") { echo "Email sent!"; } else { echo "Email failed. Please try again."; } } ?>