Changeset 414 in t29-www


Ignore:
Timestamp:
May 21, 2013, 7:48:53 PM (6 years ago)
Author:
sven
Message:

Weiterer Bugfix in Webanmeldung.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/mail/mailer.php

    r413 r414  
    162162                $this->body = $this->call_or_return_callback('body');
    163163                $this->body .= $this->call_or_return_callback('mail_info_append_text');
     164                $this->subject = $this->call_or_return_callback('subject');
    164165                $this->send_mail($this->to, $this->subject, $this->body);
    165166               
     
    172173        public function send_mail($to, $subject, $message_body)  {
    173174                // compose the header
    174                 if(!$this->header) $this->header = array();
    175                 $mailer = $this;
    176                 $testset = function($k, $v) use($mailer) { if(!isset($mailer->_values['header'][$k])) $mailer->_values['header'][$k] = $v; };
    177                
    178                 $testset('To', $to);
     175                $header = is_array($this->header) ? $this->header : array();
     176                $testset = function($k, $v) use(&$header) { if(!isset($header[$k])) $header[$k] = $v; };
     177
    179178                $testset('Content-Type', 'text/plain; charset=UTF-8'); // all t29v6 is utf-8 based!
    180179                $testset('From', 'technikum29 Computer Musem Webmailer <www@technikum29.de>');
    181180               
    182                 $additional_headers = join("\r\n", array_map(function($k) use($mailer) { return "$k: ".$mailer->header[$k]; }, array_keys($mailer->header)));
     181                $additional_headers = join("\r\n", array_map(function($k) use(&$header) { return "$k: ".$header[$k]; }, array_keys($header)));
    183182       
    184183                // debug output
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License