Full Code of agragregra/uniMail for AI

master 9a19ace3f292 cached
6 files
5.7 KB
2.0k tokens
2 symbols
1 requests
Download .txt
Repository: agragregra/uniMail
Branch: master
Commit: 9a19ace3f292
Files: 6
Total size: 5.7 KB

Directory structure:
gitextract_gkea703z/

├── .gitignore
├── readme.md
└── script/
    ├── index.html
    ├── mail.php
    ├── modx-mail.php
    └── script.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
/**/node_modules/
/dist/
/.git/
/app/css/
/**/_backstage
/**/package-lock.json
/**/Thumbs.db
/**/*.DS_Store


================================================
FILE: readme.md
================================================
<h2>Universal PHP Mail Feedback Script</h2>

<h3>How to use uniMail</h3>

<ol>
  <li>Connect <code>script.js</code> file to your project and Specify location <code>mailPath</code> in this file</li>
  <li>Add <code>uniForm</code> class to the desired <code>&lt;form&gt;</code> tags in HTML (like index.html example)</li>
  <li>Add <strong>Hidden Required Fields</strong> to your forms in HTML (like index.html example)</li>
  <li>Add any set of fields to your forms in HTML (like index.html example)</li>
  <li>Done!</li>
</ol>


================================================
FILE: script/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>uniMail</title>
  <script src="script.js" defer></script>
</head>
<body>

  <form class="uniForm">

    <h3>Form 1</h3>

    <!-- Hidden Required Fields -->
    <input type="hidden" name="project_name" value="Site Name">
    <input type="hidden" name="admin_email" value="admin@gmail.com">
    <input type="hidden" name="form_subject" value="Form Subject 1">
    <!-- END Hidden Required Fields -->

    <input type="text" name="Name" placeholder="You name..." required><br>
    <input type="text" name="E-mail" placeholder="You E-mail..." required><br>
    <input type="text" name="Phone" placeholder="You phone..."><br>

    <button>Send</button>

  </form>

  <form class="uniForm">

    <h3>Form 2</h3>

    <!-- Hidden Required Fields -->
    <input type="hidden" name="project_name" value="Site Name">
    <input type="hidden" name="admin_email" value="admin@gmail.com">
    <input type="hidden" name="form_subject" value="Form Subject 2">
    <!-- END Hidden Required Fields -->

    <input type="text" name="Name" placeholder="You name..." required><br>
    <input type="text" name="E-mail" placeholder="You E-mail..." required><br>
    <input type="text" name="Phone" placeholder="You phone..."><br>

    <button>Send</button>

  </form>

</body>
</html>

================================================
FILE: script/mail.php
================================================
<?php

$method = $_SERVER['REQUEST_METHOD'];
$c = true;

if ( $method === 'POST' ) {

  $project_name = trim($_POST["project_name"]);
  $admin_email  = trim($_POST["admin_email"]);
  $form_subject = trim($_POST["form_subject"]);

  foreach ( $_POST as $key => $value ) {
    if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
      $message .= "
      " . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
        <td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
        <td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
      </tr>
      ";
    }
  }
} else if ( $method === 'GET' ) {

  $project_name = trim($_GET["project_name"]);
  $admin_email  = trim($_GET["admin_email"]);
  $form_subject = trim($_GET["form_subject"]);

  foreach ( $_GET as $key => $value ) {
    if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
      $message .= "
      " . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
        <td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
        <td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
      </tr>
      ";
    }
  }
};

$message = "<table style='width: 100%;'>$message</table>";

function adopt($text) { return '=?UTF-8?B?'.Base64_encode($text).'?='; };

$headers = "MIME-Version: 1.0" . "\r\n" .
"Content-Type: text/html; charset=utf-8" . "\r\n" .
"From: " . adopt($project_name) . " <" . $admin_email . ">" . "\r\n" .
"Reply-To: " . $admin_email . "" . "\r\n";

mail($admin_email, adopt($form_subject), $message, $headers );


================================================
FILE: script/modx-mail.php
================================================
<?php

$method = $_SERVER['REQUEST_METHOD'];
$c = true;

if ( $method === 'POST' ) {

  $project_name = $modx->getOption('site_name');
  $admin_email  = $modx->getOption('emailsender');
  $form_subject = "Заявка с сайта " . $modx->getOption('site_name') . "";

  foreach ( $_POST as $key => $value ) {
    if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
      $message .= "
      " . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
        <td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
        <td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
      </tr>
      ";
    }
  }
} else if ( $method === 'GET' ) {

  $project_name = trim($_GET["project_name"]);
  $admin_email  = trim($_GET["admin_email"]);
  $form_subject = trim($_GET["form_subject"]);

  foreach ( $_GET as $key => $value ) {
    if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
      $message .= "
      " . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
        <td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
        <td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
      </tr>
      ";
    }
  }
};

$message = "<table style='width: 100%;'>$message</table>";

function adopt($text) { return '=?UTF-8?B?'.Base64_encode($text).'?='; };

$headers = "MIME-Version: 1.0" . "\r\n" .
"Content-Type: text/html; charset=utf-8" . "\r\n" .
"From: " . adopt($project_name) . " <" . $admin_email . ">" . "\r\n" .
"Reply-To: " . $admin_email . "" . "\r\n";

mail($admin_email, adopt($form_subject), $message, $headers );


================================================
FILE: script/script.js
================================================
const mailPath = './mail.php'

document.querySelectorAll('.uniForm').forEach( (e) => {

  e.addEventListener('submit', function(e) {

    let th      = this,
        params  = new FormData(this),
        request = new XMLHttpRequest()

    request.open('POST', mailPath, true)
    request.send(params)

    request.onreadystatechange = function() {
      if (this.readyState == 4 && this.status == 200) {
        setTimeout(function() { th.reset() }, 1000)
        alert('Thank you!')
      }
    }

    e.preventDefault()

  })

})
Download .txt
gitextract_gkea703z/

├── .gitignore
├── readme.md
└── script/
    ├── index.html
    ├── mail.php
    ├── modx-mail.php
    └── script.js
Download .txt
SYMBOL INDEX (2 symbols across 2 files)

FILE: script/mail.php
  function adopt (line 42) | function adopt($text) { return '=?UTF-8?B?'.Base64_encode($text).'?='; }

FILE: script/modx-mail.php
  function adopt (line 42) | function adopt($text) { return '=?UTF-8?B?'.Base64_encode($text).'?='; }
Condensed preview — 6 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (7K chars).
[
  {
    "path": ".gitignore",
    "chars": 108,
    "preview": "/**/node_modules/\n/dist/\n/.git/\n/app/css/\n/**/_backstage\n/**/package-lock.json\n/**/Thumbs.db\n/**/*.DS_Store\n"
  },
  {
    "path": "readme.md",
    "chars": 527,
    "preview": "<h2>Universal PHP Mail Feedback Script</h2>\n\n<h3>How to use uniMail</h3>\n\n<ol>\n  <li>Connect <code>script.js</code> file"
  },
  {
    "path": "script/index.html",
    "chars": 1337,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>uniMail</title>\n  <script src=\"script.js\" defe"
  },
  {
    "path": "script/mail.php",
    "chars": 1672,
    "preview": "<?php\n\n$method = $_SERVER['REQUEST_METHOD'];\n$c = true;\n\nif ( $method === 'POST' ) {\n\n  $project_name = trim($_POST[\"pro"
  },
  {
    "path": "script/modx-mail.php",
    "chars": 1703,
    "preview": "<?php\n\n$method = $_SERVER['REQUEST_METHOD'];\n$c = true;\n\nif ( $method === 'POST' ) {\n\n  $project_name = $modx->getOption"
  },
  {
    "path": "script/script.js",
    "chars": 533,
    "preview": "const mailPath = './mail.php'\n\ndocument.querySelectorAll('.uniForm').forEach( (e) => {\n\n  e.addEventListener('submit', f"
  }
]

About this extraction

This page contains the full source code of the agragregra/uniMail GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 6 files (5.7 KB), approximately 2.0k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!