Ignore:
Timestamp:
02/22/10 15:30:59 (3 years ago)
Author:
nick_ramsay
Message:

[Branch 1.2] New EmailFunctions class which channels all mail operations through one output. A flick of the switch and you can write email content to a log file or the screen instead of sending it (great for developers). Note that this feature won't get any use until plugins are updated to use it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/Hotaru.php

    r1213 r1214  
    11921192    public function openLog($type = 'debug', $mode = 'a+') 
    11931193    { 
    1194         $this->debug->openLog($this, $type, $mode); 
     1194        $this->debug->openLog($type, $mode); 
    11951195    } 
    11961196     
     
    12031203    public function writeLog($type = 'error', $string = '') 
    12041204    { 
    1205         $this->debug->writeLog($this, $type, $string); 
     1205        $this->debug->writeLog($type, $string); 
    12061206    } 
    12071207     
     
    12141214    public function closeLog($type = 'error') 
    12151215    { 
    1216         $this->debug->closeLog($this, $type); 
     1216        $this->debug->closeLog($type); 
    12171217    } 
    12181218     
     
    20292029        return $widget->getPluginFromFunction($this, $function); 
    20302030    } 
     2031     
     2032     
     2033/* ************************************************************* 
     2034 * 
     2035 *  EMAIL FUNCTIONS 
     2036 * 
     2037 * *********************************************************** */ 
     2038  
     2039    /** 
     2040     * Send emails 
     2041     * 
     2042     * @param string $to - defaults to SITE_EMAIL 
     2043     * @param string $subject - defaults to "No Subject"; 
     2044     * @param string $body - returns false if empty 
     2045     * @param string $headers default is "From: " . SITE_EMAIL . "\r\nReply-To: " . SITE_EMAIL . "\r\nX-Priority: 3\r\n"; 
     2046     * @param string $type - default is "email", but you can write to a "log" file, print to "screen" or "return" an array of the content 
     2047     * @return array|false - only if $type = "return" 
     2048     */ 
     2049    public function email($to = '', $subject = '', $body = '', $headers = '', $type = 'email') 
     2050    { 
     2051        require_once(LIBS . 'EmailFunctions.php'); 
     2052        $emailFunctions = new EmailFunctions($to, $subject, $body, $headers, $type); 
     2053        $emailFunctions->type = $type; 
     2054        return $emailFunctions->doEmail(); 
     2055    } 
    20312056} 
    20322057?> 
Note: See TracChangeset for help on using the changeset viewer.