setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Stats $stats = ['configs' => 0, 'winners' => 0, 'tests' => 0, 'inbox_rate' => '-', 'seeds' => 0, 'isp' => 0]; try { $stats['configs'] = $pdo->query("SELECT COUNT(*) FROM admin.brain_configs")->fetchColumn() ?: 0; } catch(Exception $e) {} try { $stats['winners'] = $pdo->query("SELECT COUNT(*) FROM admin.brain_winners")->fetchColumn() ?: 0; } catch(Exception $e) {} try { $stats['tests'] = $pdo->query("SELECT COUNT(*) FROM admin.brain_test_results")->fetchColumn() ?: 0; } catch(Exception $e) {} try { $stats['seeds'] = $pdo->query("SELECT COUNT(*) FROM admin.brain_seeds")->fetchColumn() ?: 0; } catch(Exception $e) {} try { $stats['isp'] = $pdo->query("SELECT COUNT(*) FROM admin.isp_profiles")->fetchColumn() ?: 0; } catch(Exception $e) {} try { $avg = $pdo->query("SELECT AVG(inbox_rate) FROM admin.brain_configs WHERE inbox_rate > 0")->fetchColumn(); if ($avg) $stats['inbox_rate'] = round($avg, 1) . '%'; } catch(Exception $e) {} // Action handlers $message = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $action = $_POST['action'] ?? ''; if ($action === 'create_config') { $isp_target = $_POST['isp_target'] ?? 'GMAIL'; $method = $_POST['send_method'] ?? 'OFFICE_365'; $from_name = $_POST['from_name'] ?? ''; $from_email = $_POST['from_email'] ?? ''; $subject_template = $_POST['subject_template'] ?? ''; $body_template = $_POST['body_template'] ?? ''; $return_path = $_POST['return_path'] ?? ''; $domain_used = $_POST['domain_used'] ?? ''; $reply_to = $_POST['reply_to'] ?? ''; $content_type = $_POST['content_type'] ?? 'text/html; charset=utf-8'; $encoding = $_POST['encoding'] ?? 'quoted-printable'; $h1_name = $_POST['header_1_name'] ?? ''; $h1_value = $_POST['header_1_value'] ?? ''; $h2_name = $_POST['header_2_name'] ?? ''; $h2_value = $_POST['header_2_value'] ?? ''; $hash = md5($isp_target . $method . $from_email . time()); $stmt = $pdo->prepare("INSERT INTO admin.brain_configs (config_hash, isp_target, send_method, from_name, from_email, subject_template, body_template, return_path, domain_used, reply_to, content_type, encoding, header_1_name, header_1_value, header_2_name, header_2_value, source) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'manual')"); $stmt->execute([$hash, $isp_target, $method, $from_name, $from_email, $subject_template, $body_template, $return_path, $domain_used, $reply_to, $content_type, $encoding, $h1_name, $h1_value, $h2_name, $h2_value]); $message = '✅ Configuration créée!'; } if ($action === 'delete_config') { $id = (int)$_POST['id']; $pdo->exec("DELETE FROM admin.brain_configs WHERE id = $id"); $message = '✅ Configuration supprimée!'; } } // Charger les données complètes $configs = $pdo->query("SELECT * FROM admin.brain_configs ORDER BY id DESC")->fetchAll(PDO::FETCH_ASSOC); $winners = []; try { $winners = $pdo->query("SELECT w.*, c.send_method, c.from_email, c.domain_used, c.subject_template FROM admin.brain_winners w LEFT JOIN admin.brain_configs c ON w.config_id = c.id ORDER BY w.inbox_rate DESC LIMIT 20")->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) {} $tests = []; try { $tests = $pdo->query("SELECT * FROM admin.brain_test_results ORDER BY created_at DESC LIMIT 50")->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) { error_log($e->getMessage()); } $isp_profiles = []; $isp_indexed = []; try { $isp_profiles = $pdo->query("SELECT * FROM admin.isp_profiles ORDER BY isp_name")->fetchAll(PDO::FETCH_ASSOC); foreach ($isp_profiles as $isp) { $isp_indexed[strtoupper($isp['isp_name'] ?? '')] = $isp; $isp_indexed[$isp['isp_code'] ?? ''] = $isp; } } catch(Exception $e) {} ?>
Trouver les configs qui atteignent l'INBOX sur chaque ISP
Le Brain teste automatiquement et apprend ce qui marche
Inbox rate 88-100% avec les configs gagnantes
💡 Pourquoi ? Les newsletters arrivent en INBOX = Leurs patterns fonctionnent. Le Brain copie ces patterns gagnants pour nos emails.
Configurations, Tests & Winners pour maximiser l'inbox rate
| ID | ISP Target | Méthode | From Name | From Email | Subject | Return-Path | Inbox % | Status | Actions | |
|---|---|---|---|---|---|---|---|---|---|---|
| Aucune configuration | ||||||||||
| =$c['id']?> | =htmlspecialchars($c['isp_target'] ?? '-')?> | =htmlspecialchars($c['send_method'] ?? '-')?> | =htmlspecialchars($c['from_name'] ?? '-')?> | =htmlspecialchars($c['from_email'] ?? '-')?> | =htmlspecialchars($c['subject_template'] ?? '-')?> | =htmlspecialchars($c['return_path'] ?? '-')?> | 0): ?> =$c['inbox_rate']?>% - | 🏆 Winner =htmlspecialchars($c['status'] ?? 'learning')?> Inactif | ||
Email ConfigFrom Name=htmlspecialchars($c['from_name'] ?? '-')?>
From Email=htmlspecialchars($c['from_email'] ?? '-')?>
Reply-To=htmlspecialchars($c['reply_to'] ?? '-')?>
Return-Path=htmlspecialchars($c['return_path'] ?? '-')?>
Subject=htmlspecialchars($c['subject_template'] ?? '-')?>
Domain=htmlspecialchars($c['domain_used'] ?? '-')?>
IP Used=htmlspecialchars($c['ip_used'] ?? '-')?>
Headers & FormatContent-Type=htmlspecialchars($c['content_type'] ?? '-')?>
Encoding=htmlspecialchars($c['encoding'] ?? '-')?>
Charset=htmlspecialchars($c['charset'] ?? 'utf-8')?>
Header 1=htmlspecialchars(($c['header_1_name'] ?? '') . ': ' . ($c['header_1_value'] ?? '-'))?>
Header 2=htmlspecialchars(($c['header_2_name'] ?? '') . ': ' . ($c['header_2_value'] ?? '-'))?>
Header 3=htmlspecialchars(($c['header_3_name'] ?? '') . ': ' . ($c['header_3_value'] ?? '-'))?>
Header 4=htmlspecialchars(($c['header_4_name'] ?? '') . ': ' . ($c['header_4_value'] ?? '-'))?>
Header 5=htmlspecialchars(($c['header_5_name'] ?? '') . ': ' . ($c['header_5_value'] ?? '-'))?>
Links & TrackingLink URL=htmlspecialchars($c['link_url'] ?? '-')?>
Image URL=htmlspecialchars($c['image_url'] ?? '-')?>
Redirect Domain=htmlspecialchars($c['redirect_domain'] ?? '-')?>
Tracking Domain=htmlspecialchars($c['tracking_domain'] ?? '-')?>
Unsubscribe URL=htmlspecialchars($c['unsubscribe_url'] ?? '-')?>
List-Unsubscribe=htmlspecialchars($c['list_unsubscribe'] ?? '-')?>
DNS & AuthSPF Record=htmlspecialchars($c['spf_record'] ?? '-')?>
DKIM Selector=htmlspecialchars($c['dkim_selector'] ?? '-')?>
DMARC Policy=htmlspecialchars($c['dmarc_policy'] ?? '-')?>
SMTP Type=htmlspecialchars($c['smtp_type'] ?? '-')?>
SMTP Account=$c['smtp_account_id'] ?? '-'?>
Config Hash=substr($c['config_hash'] ?? '-', 0, 16)?>...
Stats & DeliveryTotal Sent=$c['total_sent'] ?? 0?>
Inbox=$c['inbox_count'] ?? 0?>
Spam=$c['spam_count'] ?? 0?>
Bounce=$c['bounce_count'] ?? 0?>
Inbox Rate=$c['inbox_rate'] ?? 0?>%
Confidence=$c['confidence_score'] ?? 0?>%
Stability=$c['stability_score'] ?? 0?>%
Consec. Inbox=$c['consecutive_inbox'] ?? 0?>
Consec. Spam=$c['consecutive_spam'] ?? 0?>
ISP Config (=htmlspecialchars($c['isp_target'] ?? '-')?>)Filter Type=htmlspecialchars($isp_info['filter_type'] ?? '-')?>
Volume/jour=$isp_info['recommended_volume'] ?? '-'?>
Delay (sec)=$isp_info['recommended_delay'] ?? '-'?>s
Best Time=htmlspecialchars($isp_info['best_send_time'] ?? '-')?>
Avg Inbox %=$isp_info['inbox_rate_avg'] ?? '-'?>%
Notes=htmlspecialchars(substr($isp_info['notes'] ?? '-', 0, 40))?>
Pas de profil ISP pour =htmlspecialchars($c['isp_target'] ?? '-')?>
Placeholders Disponibles{name} Nom{firstname} Prénom{lastname} Nom{email} Email{domain} Domaine{company} Entreprise{date} Date{id} ID unique{random} Aléatoire{unsubscribe} Désinscrire{tracking} Pixel{offer_link} Lien offre
Spintax:
{spin:opt1|opt2|opt3}
Body Template (HTML) =strlen($c['body_template'])?> caractères=htmlspecialchars($c['body_template'])?> Body Template - Non défini |
||||||||||
| ID | Job ID | Config | Seed | Send Status | Check Status | Result | Subject | Date |
|---|---|---|---|---|---|---|---|---|
| Aucun test effectué - Lancez des tests pour voir les résultats ici | ||||||||
| =$t['id']?> | =substr($t['job_id'] ?? '-', 0, 8)?> |
#=$t['config_id']?> | =$t['seed_id'] ?? '-'?> | =$t['send_status'] ?? '-'?> | =$t['check_status'] ?? '-'?> | =$t['result'] ?? '-'?> | =htmlspecialchars(substr($t['subject_used'] ?? '-', 0, 30))?> | =substr($t['created_at'] ?? '-', 0, 16)?> |
| ID | Config | ISP Target | Méthode | Domain | Inbox Rate | Total Tests | Stability | Daily Limit | Verified |
|---|---|---|---|---|---|---|---|---|---|
| Aucun winner | |||||||||
| =$w['id']?> | #=$w['config_id']?> | =htmlspecialchars($w['isp_target'] ?? '-')?> | =htmlspecialchars($w['send_method'] ?? '-')?> | =htmlspecialchars($w['domain_used'] ?? '-')?> | =number_format($w['inbox_rate'] ?? 0, 2)?>% | =$w['total_tests'] ?? '-'?> | =$w['stability_score'] ?? '-'?>% | =$w['daily_limit'] ?? 1000?> | =substr($w['verified_at'] ?? '-', 0, 10)?> |
| ISP | Code | Filter | Volume | Delay | Best Time | Avg Rate |
|---|---|---|---|---|---|---|
| Aucun profil ISP | ||||||
| =htmlspecialchars($isp['isp_name'])?> | =htmlspecialchars($isp['isp_code'] ?? '-')?> |
=htmlspecialchars($isp['filter_type'] ?? '-')?> | =$isp['recommended_volume'] ?? '-'?> | =$isp['recommended_delay'] ?? '-'?>s | =$isp['best_send_time'] ?? '-'?> | =$isp['inbox_rate_avg'] ?? '-'?>% |