<commit_before><?php
namespace Criterion\Helper;

class Notifications
{
    public static function failedEmail($test, $project)
    {
        $config = json_decode(file_get_contents(CONFIG_FILE), true);
        if (isset($project['email']) && $project['email'] && isset($config['email']))
        {
            $subject = '['.$project['repo'].'] Tests Failed (' . $test . ')';
            $message = "This is a short email to let you know that the following project's tests are failing: \n\n";
            $message .= $config['url'] . '/test/' . $test . "\n\n";
            $message .= 'Thanks';

            return self::email($project['email'], $config['email'], $subject, $message);
        }
        return false;
    }

    private static function email($to, $from, $subject, $message)
    {
        return mail($to, $subject, $message);
    }
}<commit_msg>Add from headers in mail<commit_after><?php
namespace Criterion\Helper;

class Notifications
{
    public static function failedEmail($test, $project)
    {
        $config = json_decode(file_get_contents(CONFIG_FILE), true);
        if (isset($project['email']) && $project['email'] && isset($config['email']))
        {
            $subject = '['.$project['repo'].'] Tests Failed (' . $test . ')';
            $message = "This is a short email to let you know that the following project's tests are failing: \n\n";
            $message .= $config['url'] . '/test/' . $test . "\n\n";
            $message .= 'Thanks';

            return self::email($project['email'], $config['email'], $subject, $message);
        }
        return false;
    }

    private static function email($to, $from, $subject, $message)
    {
        $headers = "From:" . $from;
        return mail($to, $subject, $message, $headers);
    }
}
{'fraction_non_alphanumeric': 0.17405951712521056, 'fraction_numerical': 0.0, 'mean_word_length': 2.6072874493927127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4808869', 'n_tokens_mistral': 508, 'n_tokens_neox': 502, 'n_words': 138}