Dane kontaktowe
Imię i nazwisko: {{IMIE_NAZWISKO}}
Email: {{EMAIL}}
📬 Treść wiadomości:
{{WIADOMOSC}}
addShortcode(); } protected function addShortcode(): void { add_shortcode("in-contact", [$this, "inContact"]); } public function inContact($atts) { $em_name = null; $em_mail = null; $em_message = null; $class = null; $html = null; $error = null; $body = null; $telefon = null; $mailResult = 0; $form_submitted = $_SERVER["REQUEST_METHOD"] === "POST"; if (!empty($_POST["website"])) { die(); } if ($form_submitted) { $emmsg = isset($_POST["emmsg"]) ? $_POST["emmsg"] : ""; if (!empty($_POST["em_name"])) { $em_name = $_POST["em_name"]; } else { $error .= "Please enter your name "; } if (!empty($_POST["em_mail"])) { $em_mail = $_POST["em_mail"]; } else { $error .= "Please enter your email address "; } if (!empty($_POST["em_message"])) { $em_message = $_POST["em_message"]; } else { $error .= "Please enter your message "; } $targetEmail = "To: Tylkofotografia <" . get_option("incontact-target-mail") . ">"; $mailResult = 0; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type: text/html; charset=" . get_bloginfo("charset") . "" . "\r\n"; $headers .= "From: " . $em_name . " <" . $em_mail . ">" . "\r\n"; $headers = [ "Content-Type: text/html; charset=UTF-8", "From: " . $em_name . " <" . $em_mail . ">", "Reply-To: " . $em_name . " <" . $em_mail . ">", ]; $body = '
Imię i nazwisko: {{IMIE_NAZWISKO}}
Email: {{EMAIL}}
{{WIADOMOSC}}