Ignore:
Timestamp:
2008/09/02 16:17:59 (16 years ago)
Author:
Seasoft
Message:

r17375 に対応する初期データを追加
・SC_Helper_Mail::sfMakeSubject() でのオブジェクト流用(参照渡し)を解消。呼び出し元から変数を渡すことを想定していたのか不安がある。
・未使用パラメータの削除

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/helper/SC_Helper_Mail.php

    r17375 r17590  
    6969        if ($reply_to == "") $reply_to = $arrInfo['email03']; 
    7070        $error = $arrInfo['email04']; 
    71         $tosubject = $tmp_subject; 
     71        $tosubject = $this->sfMakeSubject($tmp_subject); 
     72         
    7273        $objSendMail->setItem('', $tosubject, $body, $from_address, $from_name, $reply_to, $error, $error); 
    7374        $objSendMail->setTo($to, $to_name); 
     
    145146        $from = $arrInfo['email03']; 
    146147        $error = $arrInfo['email04']; 
    147  
    148         $tosubject = $this->sfMakeSubject($objQuery, $objMailView, 
    149                                              $objPage, $tmp_subject); 
     148        $tosubject = $this->sfMakeSubject($tmp_subject); 
    150149 
    151150        $objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
     
    164163 
    165164    // テンプレートを使用したメールの送信 
    166     function sfSendTplMail($to, $subject, $tplpath, &$objPage) { 
     165    function sfSendTplMail($to, $tmp_subject, $tplpath, &$objPage) { 
    167166        $objMailView = new SC_SiteView(); 
    168167        $objSiteInfo = new SC_SiteInfo(); 
     
    179178        $from = $arrInfo['email03']; 
    180179        $error = $arrInfo['email04']; 
    181         $objSendMail->setItem($to, $subject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
     180        $tosubject = $this->sfMakeSubject($tmp_subject); 
     181         
     182        $objSendMail->setItem($to, $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
    182183        $objSendMail->sendMail(); 
    183184    } 
    184185 
    185186    // 通常のメール送信 
    186     function sfSendMail($to, $subject, $body) { 
     187    function sfSendMail($to, $tmp_subject, $body) { 
    187188        $objSiteInfo = new SC_SiteInfo(); 
    188189        $arrInfo = $objSiteInfo->data; 
     
    192193        $from = $arrInfo['email03']; 
    193194        $error = $arrInfo['email04']; 
    194         $objSendMail->setItem($to, $subject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
     195        $tosubject = $this->sfMakeSubject($tmp_subject); 
     196         
     197        $objSendMail->setItem($to, $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc); 
    195198        $objSendMail->sendMail(); 
    196199    } 
    197200 
    198201    //件名にテンプレートを用いる 
    199     function sfMakeSubject(&$objQuery, &$objMailView, &$objPage, $subject){ 
    200  
     202    function sfMakeSubject($subject) { 
     203        $objQuery = new SC_Query(); 
     204        $objMailView = new SC_SiteView(); 
     205        $objTplAssign = new stdClass; 
     206         
    201207        $arrInfo = $objQuery->select("*","dtb_baseinfo"); 
    202208        $arrInfo = $arrInfo[0]; 
    203         $objPage->tpl_shopname=$arrInfo['shop_name']; 
    204         $objPage->tpl_infoemail=$subject; 
    205         $objMailView->assignobj($objPage); 
    206         $mailtitle = $objMailView->fetch('mail_templates/mail_title.tpl'); 
    207         $ret = $mailtitle.$subject; 
    208         return $ret; 
     209        $objTplAssign->tpl_shopname=$arrInfo['shop_name']; 
     210        $objTplAssign->tpl_infoemail=$subject; // 従来互換 
     211        $objTplAssign->tpl_mailtitle=$subject; 
     212        $objMailView->assignobj($objTplAssign); 
     213        $subject = $objMailView->fetch('mail_templates/mail_title.tpl'); 
     214        return $subject; 
    209215    } 
    210216 
Note: See TracChangeset for help on using the changeset viewer.