<commit_before><?php

include_once("../php/class.experiment.php");
$experiment = new Experiment($_REQUEST['exp'], False);

$tomorrow = date('Y/m/d', strtotime(date('Y-m-d')) + 86400);
$tomorrow_slots = $experiment->getDate($tomorrow);

if ($_REQUEST['confirm'] == 'true') {

  $page = 'view';

  $fails = array();

  foreach ($tomorrow_slots as $time=>$slot) {
    if ($slot != None) {
      foreach ($slot as $subject) {
        if ($experiment->sendEmail($subject[0], $user->getName(), $user->getEmail(), 'email_reminder', array('NAME'=>$subject[0], 'TIME'=>$time)) == False) {
          $fails[] = $subject_name;
        }
      }
    }
  }

  $fails = implode(', ', $fails);
  if ($fails == '') {
    $notification = 'Reminder emails were successfully sent to tomorrow’s participants';
    $notification_colour = 'green';
  }
  else {
    $notification = 'Emails failed to send to: ' . $fails;
    $notification_colour = 'red';
  }

  $notification = '<div id="notification" class="notification-'. $notification_colour .'"><p>' . $notification . '</p></div>';

}

else {

  $name_email = array();

  foreach ($tomorrow_slots as $time=>$slot) {<commit_msg>Fixed email bugs<commit_after><?php

include_once("../php/class.experiment.php");
$experiment = new Experiment($_REQUEST['exp'], False);

$tomorrow = date('Y/m/d', strtotime(date('Y-m-d')) + 86400);
$tomorrow_slots = $experiment->getDate($tomorrow);

if ($_REQUEST['confirm'] == 'true') {

  $page = 'view';

  $fails = array();

  $formatted_date = date('l jS F', strtotime($date));

  foreach ($tomorrow_slots as $time=>$slot) {
    if ($slot != None) {
      foreach ($slot as $subject) {
        if ($experiment->sendEmail($subject[1], $user->getName(), $user->getEmail(), 'email_reminder', array('NAME'=>$subject[0], 'DATE'=>$formatted_date, 'TIME'=>$time)) == False) {
          $fails[] = $subject_name;
        }
      }
    }
  }

  $fails = implode(', ', $fails);
  if ($fails == '') {
    $notification = 'Reminder emails were successfully sent to tomorrow’s participants';
    $notification_colour = 'green';
  }
  else {
    $notification = 'Emails failed to send to: ' . $fails;
    $notification_colour = 'red';
  }

  $notification = '<div id="notification" class="notification-'. $notification_colour .'"><p>' . $notification . '</p></div>';

}

else {

  $name_email = array();

  foreach ($tomorrow_slots as $time=>$slot) {
{'fraction_non_alphanumeric': 0.2086630570595585, 'fraction_numerical': 0.0058309037900874635, 'mean_word_length': 3.872210953346856, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 28, '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': '630125', 'n_tokens_mistral': 834, 'n_tokens_neox': 808, 'n_words': 170}