<commit_before><?php
/**  
 * Mail class
 * 
 * Handles mail activity
 * 	
 * @access		public
 */
 
class Mail {
			
  /**
   * Sends a simple mail message to $to, with $body as the body
   * and $subject as the subject
   *
   * @return  bool
   */
  function SimpleMail($to, $subject, $body, $attachFooter = true, $bcc = false, $opt = false) {
   
   $mg_from = "".UNIVERSITY." Humans vs. Zombies <".EMAIL.">";
   $sig = "\r\nThanks,\n".UNIVERSITY." Humans vs. Zombies";
   $mg_api = MAILGUN_API_KEY;
   $mg_version = 'api.mailgun.net/v2/';
   $mg_domain = "osundead.com";
   $mg_reply_to_email = EMAIL_REPLY_TO;   
   $mg_message_url = "https://".$mg_version.$mg_domain."/messages"; 
    // $to can be single email or comma seperated
      
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
   curl_setopt($ch, CURLOPT_USERPWD, 'api:' . $mg_api);
   curl_setopt($ch, CURLOPT_POST, true);
   curl_setopt($ch, CURLOPT_URL, $mg_message_url);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      
   $postfields = array(  'from'      => $mg_from,
                         'h:Reply-To'=> '<' . $mg_reply_to_email . '>',
                         'subject'   => $subject,
                         'text'      => $body,
            );
      if ($bcc) {
        $postfields["bcc"] = $to;
        $postfields["to"]  = ARCHIVE_EMAIL;
      } else {
        $postfields["to"] = $to;
      }

      if ($opt) {
        foreach ($opt as $option => $value){
        	$postfields[option] = $value;
        }<commit_msg>Add email tracking<commit_after><?php
/**  
 * Mail class
 * 
 * Handles mail activity
 * 	
 * @access		public
 */
 
class Mail {
			
  /**
   * Sends a simple mail message to $to, with $body as the body
   * and $subject as the subject
   *
   * @return  bool
   */
  function SimpleMail($to, $subject, $body, $attachFooter = true, $bcc = false, $opt = false) {
   
   $mg_from = "".UNIVERSITY." Humans vs. Zombies <".EMAIL.">";
   $sig = "\r\nThanks,\n".UNIVERSITY." Humans vs. Zombies";
   $mg_api = MAILGUN_API_KEY;
   $mg_version = 'api.mailgun.net/v2/';
   $mg_domain = "osundead.com";
   $mg_reply_to_email = EMAIL_REPLY_TO;   
   $mg_message_url = "https://".$mg_version.$mg_domain."/messages"; 
    // $to can be single email or comma seperated
      
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
   curl_setopt($ch, CURLOPT_USERPWD, 'api:' . $mg_api);
   curl_setopt($ch, CURLOPT_POST, true);
   curl_setopt($ch, CURLOPT_URL, $mg_message_url);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      
   $postfields = array(  'from'      => $mg_from,
                         'h:Reply-To'=> '<' . $mg_reply_to_email . '>',
                         'subject'   => $subject,
                         'html'      => $body,
            );
      if ($bcc) {
        $postfields["bcc"] = $to;
        $postfields["to"]  = ARCHIVE_EMAIL;
      } else {
        $postfields["to"] = $to;
      }

      if ($opt) {
        foreach ($opt as $option => $value){
        	$postfields[$option] = $value;
        }
{'fraction_non_alphanumeric': 0.16071428571428573, 'fraction_numerical': 0.0006493506493506494, 'mean_word_length': 2.2397476340694005, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '1731854', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1121, 'n_words': 230}