Changeset 41 for trunk/lib/Email.inc.php


Ignore:
Timestamp:
Dec 17, 2005 9:11:26 AM (18 years ago)
Author:
scdev
Message:

${1}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Email.inc.php

    r40 r41  
    1616));
    1717$email->setTemplate('email_registration_confirm.ihtml');
     18// $email->setString('Or you can pass your message body as a string, also with {VARIABLES}.');
    1819$email->replace(array(
    1920    'site_name' => App::getParam('site_name'),
     
    153154    {
    154155        // Load file, using include_path.
    155         if ('' == $string) {
     156        if ('' == trim($string)) {
    156157            App::logMsg(sprintf('Empty string provided.', null), LOG_ERR, __FILE__, __LINE__);
    157158            $this->_template_replaced = null;
    158159            return false;
    159160        } else {
    160             $_template = $string;
     161            $this->_template = $string;
    161162            // This could be a new template, so reset the _template_replaced.
    162163            $this->_template_replaced = null;
     
    244245        // Ensure all placeholders have been replaced. Find anything with {...} characters.
    245246        if (preg_match('/({[^}]+})/', $final_body, $unreplaced_match)) {
    246             App::logMsg(sprintf('Cannot send email. Variables left unreplaced in template: %s', (isset($unreplaced_match) ? $unreplaced_match[1] : '')), LOG_ERR, __FILE__, __LINE__);
     247            App::logMsg(sprintf('Cannot send email. Variables left unreplaced in template: %s', (isset($unreplaced_match[1]) ? $unreplaced_match[1] : '')), LOG_ERR, __FILE__, __LINE__);
    247248            return false;
    248249        }
Note: See TracChangeset for help on using the changeset viewer.