aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/mail.controller.php31
-rw-r--r--app/views/mail-error.view.php32
-rw-r--r--app/views/mail-sent.view.php27
3 files changed, 0 insertions, 90 deletions
diff --git a/app/controllers/mail.controller.php b/app/controllers/mail.controller.php
deleted file mode 100644
index ce593d6..0000000
--- a/app/controllers/mail.controller.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-use PHPMailer\PHPMailer\PHPMailer;
-use PHPMailer\PHPMailer\Exception;
-
-$form = new Form(
- $name = $_POST['26471'] ?? null,
- $email = $_POST['26472'] ?? null,
- $message = $_POST['26478'] ?? null
-);
-
-$validEmail = PHPMailer::validateAddress($email, 'auto');
-
-if ($validEmail === false ) {
- $mailError = 'Invalid email' . "\r" . '<em>'. $email . '</em>';
- include '../app/views/mail-error.view.php';
- return;
-}
-
-require '../app/views/mail-sent.view.php';
-
-fastcgi_finish_request();
-$form->isSubmit();
-
-$contact['database']->insert(
- 'contactform', [
- 'name' => $form->name,
- 'email' => $form->email,
- 'message' => $form->message,
- ]
-);
diff --git a/app/views/mail-error.view.php b/app/views/mail-error.view.php
deleted file mode 100644
index 24e45d2..0000000
--- a/app/views/mail-error.view.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php require __DIR__ . '/partials/header.php'; ?>
-
-<body>
-
- <section class="section hero is-fullheight" itemscope itemtype="http://schema.org/WebPage">
-
- <div class="hero-head">
-
- <?php require __DIR__ . '/partials/navigator.php'; ?>
-
- </div>
-
- <div class="hero-body">
- <div class="container">
- <div class="columns is-centered">
- <div class="column is-7 has-text-centered">
-
- <br>
- <p><?php echo 'The message could not be sent. <br> Mailer Reply:'. "\r", $mailError; ?></p>
- <br>
- <a href="/contact"><b>Return to the Contact Page</b></a>
- <br>
-
- </div>
- </div>
- </div>
- </div>
-
-<?php require __DIR__ . '/partials/footer.php'; ?>
-
- </body>
-</html>
diff --git a/app/views/mail-sent.view.php b/app/views/mail-sent.view.php
deleted file mode 100644
index 43f68ad..0000000
--- a/app/views/mail-sent.view.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php require __DIR__ . '/partials/header.php'; ?>
-
- <body>
-
- <section class="section hero is-fullheight" itemscope itemtype="http://schema.org/HomePage">
-
- <div class="hero-head">
- <?php require __DIR__ . '/partials/navigator.php'; ?>
- </div>
-
- <div class="hero-body">
- <div class="container">
- <div class="columns is-centered">
- <div class="column is-7 has-text-centered">
- <article class="has-text-centered">
- <h3>Thank you for your message.</h3>
- <a href="/"><b>Return to the Home Page</b></a>
- </article>
- </div>
- </div>
- </div>
- </div>
-
-<?php require __DIR__ . '/partials/footer.php'; ?>
-
- </body>
-</html>