Changeset 17375


Ignore:
Timestamp:
2008/06/26 15:27:38 (16 years ago)
Author:
pineray
Message:

メールテンプレート周り

Location:
branches/comu-ver2
Files:
3 edited

Legend:

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

    r16741 r17375  
    4545 
    4646    /* DBに登録されたテンプレートメールの送信 */ 
    47     function sfSendTemplateMail($to, $to_name, $template_id, &$objPage) { 
     47    function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = "", $from_name = "", $reply_to = "") { 
    4848 
    4949        $objQuery = new SC_Query(); 
     
    6565        // メール送信処理 
    6666        $objSendMail = new SC_SendMail_Ex(); 
    67         $from = $arrInfo['email03']; 
     67        if ($from_address == "") $from_address = $arrInfo['email03']; 
     68        if ($from_name == "") $from_name = $arrInfo['shop_name']; 
     69        if ($reply_to == "") $reply_to = $arrInfo['email03']; 
    6870        $error = $arrInfo['email04']; 
    6971        $tosubject = $tmp_subject; 
    70         $objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error); 
     72        $objSendMail->setItem('', $tosubject, $body, $from_address, $from_name, $reply_to, $error, $error); 
    7173        $objSendMail->setTo($to, $to_name); 
    7274        $objSendMail->sendMail();    // メール送信 
     
    8688            // メールテンプレート情報の取得 
    8789            $where = "template_id = ?"; 
    88             $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array('1')); 
     90            $arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id)); 
    8991            $objPage->tpl_header = $arrRet[0]['header']; 
    9092            $objPage->tpl_footer = $arrRet[0]['footer']; 
  • branches/comu-ver2/data/class/pages/contact/LC_Page_Contact.php

    r17303 r17375  
    273273        $CONF = $objDb->sf_getBasisData();          // 店舗基本情報 
    274274        $objQuery = new SC_Query(); 
    275         $objMailText = new SC_SiteView(); 
    276275        $objSiteInfo = $this->objView->objSiteInfo; 
    277276        $arrInfo = $objSiteInfo->data; 
    278         $objPage->tpl_shopname=$arrInfo['shop_name']; 
     277        $objPage->tpl_shopname = $arrInfo['shop_name']; 
    279278        $objPage->tpl_infoemail = $arrInfo['email02']; 
    280         $objMailText->assignobj($objPage); 
    281         $toCustomerMail = $objMailText->fetch("mail_templates/contact_mail.tpl"); 
    282         $objMail = new SC_SendMail(); 
    283  
    284         if ( $objPage->arrForm['email'] ) { 
    285             $fromMail_name = $objPage->arrForm['name01'] ." 様"; 
    286             $fromMail_address = $objPage->arrForm['email']; 
    287         } else { 
    288             $fromMail_name = $CONF["shop_name"]; 
    289             $fromMail_address = $CONF["email02"]; 
    290         } 
     279 
     280        $fromMail_name = $objPage->arrForm['name01'] ." 様"; 
     281        $fromMail_address = $objPage->arrForm['email']; 
     282 
    291283        $helperMail = new SC_Helper_Mail_Ex(); 
    292         $subject = $helperMail->sfMakeSubject($objQuery, $objMailText, $this, "お問い合わせがありました。"); 
    293         $objMail->setItem( 
    294                               $CONF["email02"]                  // 宛先 
    295                             , $subject                          // サブジェクト 
    296                             , $toCustomerMail                   // 本文 
    297                             , $fromMail_address                 // 配送元アドレス 
    298                             , $fromMail_name                    // 配送元 名前 
    299                             , $fromMail_address                 // reply_to 
    300                             , $CONF["email04"]                  // return_path 
    301                             , $CONF["email04"]                  //  Errors_to 
    302                                                             ); 
    303         $objMail->sendMail(); 
    304  
    305         $subject = $helperMail->sfMakeSubject($objQuery, $objMailText, $this, "お問い合わせを受け付けました。"); 
    306         $objMail->setItem( 
    307                               ''                                // 宛先 
    308                             , $subject                          // サブジェクト 
    309                             , $toCustomerMail                   // 本文 
    310                             , $CONF["email03"]                  // 配送元アドレス 
    311                             , $CONF["shop_name"]                // 配送元 名前 
    312                             , $CONF["email02"]                  // reply_to 
    313                             , $CONF["email04"]                  // return_path 
    314                             , $CONF["email04"]                  //  Errors_to 
    315                                                             ); 
    316         $objMail->setTo($objPage->arrForm['email'], $objPage->arrForm['name01'] ." 様"); 
    317         $objMail->sendMail(); 
     284        $helperMail->sfSendTemplateMail($CONF["email02"], $CONF["shop_name"], "5", $objPage, $fromMail_address, $fromMail_name, $fromMail_address); 
     285        $helperMail->sfSendTemplateMail($objPage->arrForm['email'], $objPage->arrForm['name01'] ." 様", "5", $objPage, $CONF["email03"], $CONF["shop_name"], $CONF["email02"]); 
    318286    } 
    319287} 
  • branches/comu-ver2/html/install/sql/insert_data.sql

    r17355 r17375  
    643643INSERT INTO mtb_taxrule VALUES ('3', '切り上げ',2); 
    644644INSERT INTO mtb_mail_template VALUES ('1', '注文受付メール',0); 
    645 INSERT INTO mtb_mail_template VALUES ('2', '注文キャンセル受付メール',1); 
    646 INSERT INTO mtb_mail_template VALUES ('3', '取り寄せ確認メール',2); 
     645INSERT INTO mtb_mail_template VALUES ('2', '注文受付メール(携帯)',1); 
     646INSERT INTO mtb_mail_template VALUES ('3', '注文キャンセル受付メール',2); 
     647INSERT INTO mtb_mail_template VALUES ('4', '取り寄せ確認メール',3); 
     648INSERT INTO mtb_mail_template VALUES ('5', 'お問い合わせ受付メール',4); 
    647649INSERT INTO mtb_mail_tpl_path VALUES ('1', 'mail_templates/order_mail.tpl',0); 
    648650INSERT INTO mtb_mail_tpl_path VALUES ('2', 'mobile/mail_templates/order_mail.tpl',1); 
    649651INSERT INTO mtb_mail_tpl_path VALUES ('3', 'mail_templates/order_mail.tpl',2); 
    650 INSERT INTO mtb_mail_tpl_path VALUES ('4', 'mail_templates/contact_mail.tpl',3); 
     652INSERT INTO mtb_mail_tpl_path VALUES ('4', 'mail_templates/order_mail.tpl',3); 
     653INSERT INTO mtb_mail_tpl_path VALUES ('5', 'mail_templates/contact_mail.tpl',4); 
    651654INSERT INTO mtb_job VALUES ('1', '公務員',0); 
    652655INSERT INTO mtb_job VALUES ('2', 'コンサルタント',1); 
Note: See TracChangeset for help on using the changeset viewer.