Changeset 566 for branches/1.1dev/lib


Ignore:
Timestamp:
Oct 28, 2016 12:03:20 AM (8 years ago)
Author:
anonymous
Message:

Added ->error_reporting option. Updated Email->replace() to return replaced string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/lib/Email.inc.php

    r310 r566  
    88 * @author  Quinn Comendant <quinn@strangecode.com>
    99 * @version 1.0 - backported to codebase v1.1dev
    10  * 
    11  
     10 *
     11
    1212// Example.
    1313$email = new Email(array(
     
    3030}
    3131
    32  * 
     32 *
    3333 */
    3434class Email {
     
    4141        'headers' => null,
    4242        'regex' => null,
    43        
     43
    4444        // A single carriage return (\n) should terminate lines for locally injected mail.
    4545        // A carriage return + line-feed (\r\n) should be used if sending mail directly with SMTP.
    4646        'crlf' => "\n",
    47        
     47
    4848        // RFC 2822 says line length MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.
    4949        // http://mailformat.dan.info/body/linelength.html
     
    187187    function replace($replacements)
    188188    {
    189    
     189
    190190        // Ensure template exists.
    191191        if (!isset($this->_template)) {
     
    209209        // Search and replace all values at once.
    210210        $this->_template_replaced = str_replace($search, $replace, $this->_template);
     211
     212        return $this->_template_replaced;
    211213    }
    212214
     
    255257        $final_body = isset($this->_template_replaced) ? $this->_template_replaced : $this->_template;
    256258        if (false !== $this->getParam('wrap')) {
    257             $final_body = wordwrap($final_body, $this->getParam('line_length'), $this->getParam('crlf'));           
     259            $final_body = wordwrap($final_body, $this->getParam('line_length'), $this->getParam('crlf'));
    258260        }
    259261
     
    287289            $envelope_sender_header = sprintf('-f %s', $envelope_sender_address);
    288290        } else {
    289             $envelope_sender_header = '';           
     291            $envelope_sender_header = '';
    290292        }
    291293
Note: See TracChangeset for help on using the changeset viewer.