<commit_before><?php
/*
Copyright © 2014, <NAME>
This file is part of Journal Club Manager.

Journal Club Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Journal Club Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Journal Club Manager.  If not, see <http://www.gnu.org/licenses/>.
*/

@session_start();
$_SESSION['app_name'] = basename(dirname(__DIR__));
$_SESSION['path_to_app'] = dirname(dirname(__FILE__))."/";
$_SESSION['path_to_includes'] = $_SESSION['path_to_app']."includes/";
date_default_timezone_set('Europe/Paris');

// Includes
require_once($_SESSION['path_to_includes'].'includes.php');

// Execute cron job
function mailing() {
    // Declare classes
    $mail = new myMail();
    $config = new site_config('get');

	// Count number of users
    $nusers = count($mail->get_mailinglist("notification"));

	// today's day
    $cur_date = strtolower(date("l"));

    if ($cur_date == $config->notification) {
        $content = $mail->advertise_mail();
        $body = $mail -> formatmail($content['body']);
        print_r($body);exit;
        $subject = $content['subject'];
        if ($mail->send_to_mailinglist($subject,$body,"notification")) {
            $string = "[".date('Y-m-d H:i:s')."]: message sent successfully to $nusers users.\r\n";
        } else {
            $string = "[".date('Y-m-d H:i:s')."]: ERROR message not sent.\r\n";
        }

	    echo($string);

	    // Write log
	    $cronlog = 'mailing_log.txt';
	    if (!is_file($cronlog)) {
	        $fp = fopen($cronlog,"w");
	        chmod($cronlog,0777);<commit_msg>Do not print the body content of emails anymore<commit_after><?php
/*
Copyright © 2014, <NAME>
This file is part of Journal Club Manager.

Journal Club Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Journal Club Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Journal Club Manager.  If not, see <http://www.gnu.org/licenses/>.
*/

@session_start();
$_SESSION['app_name'] = basename(dirname(__DIR__));
$_SESSION['path_to_app'] = dirname(dirname(__FILE__))."/";
$_SESSION['path_to_includes'] = $_SESSION['path_to_app']."includes/";
date_default_timezone_set('Europe/Paris');

// Includes
require_once($_SESSION['path_to_includes'].'includes.php');

// Execute cron job
function mailing() {
    // Declare classes
    $mail = new myMail();
    $config = new site_config('get');

	// Count number of users
    $nusers = count($mail->get_mailinglist("notification"));

	// today's day
    $cur_date = strtolower(date("l"));

    if ($cur_date == $config->notification) {
        $content = $mail->advertise_mail();
        $body = $mail -> formatmail($content['body']);
        $subject = $content['subject'];
        if ($mail->send_to_mailinglist($subject,$body,"notification")) {
            $string = "[".date('Y-m-d H:i:s')."]: message sent successfully to $nusers users.\r\n";
        } else {
            $string = "[".date('Y-m-d H:i:s')."]: ERROR message not sent.\r\n";
        }

	    echo($string);

	    // Write log
	    $cronlog = 'mailing_log.txt';
	    if (!is_file($cronlog)) {
	        $fp = fopen($cronlog,"w");
	        chmod($cronlog,0777);
{'fraction_non_alphanumeric': 0.1410921670373116, 'fraction_numerical': 0.004447739065974796, 'mean_word_length': 3.685185185185185, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5245702', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1188, 'n_words': 388}