<commit_before><?php

require_once 'PHPMailer/src/PHPMailer.php';
require_once 'PHPMailer/src/Exception.php';

if (!file_exists('is_iterable')) {
	function is_iterable($obj)
	{
		return is_array($obj) || $obj instanceof \Traversable;
	}
} 

use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;

class MailFacade
{

    private $EMAIL_OPTIONS = array(
        'TITLE' => 'StudentIngegneria',
        'URL' => 'http://www.Studentingegneria.it',
        'FROM' => '<EMAIL>',
        'CHARSET_UTF8' => 'utf-8',
        'TYPE' => 'text/html',
        'MULTIPART_TYPE' => 'multipart/mixed',
    );

    public function __construct()
    {
        $this->mailer = new PHPMailer(true);
        $this->mailer->setFrom($this->EMAIL_OPTIONS['FROM'], $this->EMAIL_OPTIONS['TITLE']);
    }

    public function set_body($body)
    {
        $email_body = str_replace("\\", "", nl2br($body));
        $this->mailer->Body = $email_body;
    }

    public function add_attachments($attachments)
    {
        if (!is_iterable($attachments)) {
            throw new InvalidArgumentException();
        }
        foreach ($attachments as $file) {<commit_msg>aggiustato mailFacade per inviare email in html con utf-8, per risolvere problema di visualizzazione html e accenti.<commit_after><?php

require_once 'PHPMailer/src/PHPMailer.php';
require_once 'PHPMailer/src/Exception.php';

if (!file_exists('is_iterable')) {
	function is_iterable($obj)
	{
		return is_array($obj) || $obj instanceof \Traversable;
	}
} 

use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\PHPMailer;

class MailFacade
{

    private $EMAIL_OPTIONS = array(
        'TITLE' => 'StudentIngegneria',
        'URL' => 'http://www.Studentingegneria.it',
        'FROM' => '<EMAIL>',
        'CHARSET_UTF8' => 'utf-8',
        'TYPE' => 'text/html',
        'MULTIPART_TYPE' => 'multipart/mixed',
    );

    public function __construct()
    {
        $this->mailer = new PHPMailer(true);
        $this->mailer->setFrom($this->EMAIL_OPTIONS['FROM'], $this->EMAIL_OPTIONS['TITLE']);
        $this->mailer->IsHTML(true);
        $this->mailer->CharSet = "UTF-8";
    }

    public function set_body($body)
    {
        $email_body = str_replace("\\", "", nl2br($body));
        $this->mailer->Body = $email_body;
    }

    public function add_attachments($attachments)
    {
        if (!is_iterable($attachments)) {
            throw new InvalidArgumentException();
        }
        foreach ($attachments as $file) {
{'fraction_non_alphanumeric': 0.15745192307692307, 'fraction_numerical': 0.003205128205128205, 'mean_word_length': 3.066775244299674, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, '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': '7374831', 'n_tokens_mistral': 879, 'n_tokens_neox': 862, 'n_words': 145}