<commit_before><?php
require_once 'config/config.php';
require_once 'config/functions.php';
//require_once 'config/database.php';
require 'vendor/autoload.php';

$app = new \Slim\App();

$app->get('/', function ($request, $response, $args) {
    return $response->withStatus(200)->write('Service Available');
});

// TEMPLATES FUNCTIONS
// ================================================================
// WELCOME
$app->get('/welcome', function ($request, $response, $args) {
    $response->getBody()->write("Welcome");
    return $response;
});


$app->post('/welcome', function ($request, $response){

    # Get body data
    $data = $request->getParsedBody();
    # Instantiate the client
    //$messageClient = new Mailgun(MAILGUN_PRIVATE_APIKEY);

    # Email Variables
    # postData
    $from       = filter_var($data['from'],     FILTER_SANITIZE_EMAIL);
    $to         = filter_var($data['to'],       FILTER_SANITIZE_EMAIL);
    $subject    = filter_var($data['subject'],  FILTER_SANITIZE_STRING);
    $name       = filter_var($data['name'],     FILTER_SANITIZE_STRING);
    $password   = filter_var($data['password'], FILTER_SANITIZE_STRING);<commit_msg>fixing mailgun error 500<commit_after><?php
require_once 'config/config.php';
require_once 'config/functions.php';
//require_once 'config/database.php';
require 'vendor/autoload.php';

$app = new \Slim\App();

$app->get('/', function ($request, $response, $args) {
    return $response->withStatus(200)->write('Service Available');
});

// TEMPLATES FUNCTIONS
// ================================================================
// WELCOME
$app->get('/welcome', function ($request, $response, $args) {
    $response->getBody()->write("Welcome");
    return $response;
});


$app->post('/welcome', function ($request, $response){

    # Get body data
    $data = $request->getParsedBody();
    # Instantiate the client
    $client = new \Http\Adapter\Guzzle6\Client();
    $messageClient = new \Mailgun\Mailgun(MAILGUN_PRIVATE_APIKEY, $client);

    # Email Variables
    # postData
    $from       = filter_var($data['from'],     FILTER_SANITIZE_EMAIL);
    $to         = filter_var($data['to'],       FILTER_SANITIZE_EMAIL);
    $subject    = filter_var($data['subject'],  FILTER_SANITIZE_STRING);
    $name       = filter_var($data['name'],     FILTER_SANITIZE_STRING);
    $password   = filter_var($data['password'], FILTER_SANITIZE_STRING);
{'fraction_non_alphanumeric': 0.21710253217102532, 'fraction_numerical': 0.004151100041511001, 'mean_word_length': 4.343680709534368, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1236344', 'n_tokens_mistral': 805, 'n_tokens_neox': 744, 'n_words': 134}