Changeset 25358 for trunk/include


Ignore:
Timestamp:
Nov 6, 2013, 5:21:31 PM (10 years ago)
Author:
mistic100
Message:

feature feature 2995: New email template
improve mail cache system
fix font-size in Thunderbird

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_mail.inc.php

    r25357 r25358  
    308308 * current user (if admin) is excluded
    309309 * @see pwg_mail()
     310 * @since 2.6
    310311 *
    311312 * @param array $args - as in pwg_mail()
     
    583584    // key compose of indexes witch allow to cache mail data
    584585    $cache_key = $content_type.'-'.$lang_info['code'];
    585     $cache_key.= '-'.crc32(@$args['mail_title'] . @$args['mail_subtitle']); // TODO: find a way to not cache by mail_title
    586586
    587587    if (!isset($conf_mail[$cache_key]))
     
    606606          'CONTENT_ENCODING' => get_pwg_charset(),
    607607          'CONTACT_MAIL' => $conf_mail['email_webmaster'],
    608           'MAIL_TITLE' => $args['mail_title'],
    609           'MAIL_SUBTITLE' => $args['mail_subtitle'],
    610608          )
    611609        );
     
    625623        }
    626624      }
    627 
    628       $conf_mail[$cache_key]['header'] = $template->parse('mail_header', true);
    629       $conf_mail[$cache_key]['footer'] = $template->parse('mail_footer', true);
    630     }
     625    }
     626   
     627    $template = &$conf_mail[$cache_key]['theme'];
     628    $template->assign(
     629      array(
     630        'MAIL_TITLE' => $args['mail_title'],
     631        'MAIL_SUBTITLE' => $args['mail_subtitle'],
     632        )
     633      );
    631634
    632635    // Header
    633     $contents[$content_type] = $conf_mail[$cache_key]['header'];
     636    $contents[$content_type] = $template->parse('mail_header', true);
    634637
    635638    // Content
     
    663666    if (isset($tpl['filename']))
    664667    {
    665       $template = &$conf_mail[$cache_key]['theme'];
    666668      if (isset($tpl['dirname']))
    667669      {
     
    689691
    690692    // Footer
    691     $contents[$content_type].= $conf_mail[$cache_key]['footer'];
     693    $contents[$content_type].= $template->parse('mail_footer', true);
    692694  }
    693695
     
    796798
    797799  $e = new Emogrifier($content);
    798   $e->preserveStyleTag = true;
     800  // $e->preserveStyleTag = true;
    799801  return $e->emogrify();
    800802}
Note: See TracChangeset for help on using the changeset viewer.