- Timestamp:
- 2012/02/15 19:56:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Mail.php
r21481 r21514 44 44 45 45 /* DBに登録されたテンプレートメールの送信 */ 46 function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = "", $from_name = "", $reply_to = "", $bcc = '') {46 function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = '', $from_name = '', $reply_to = "", $bcc = '') { 47 47 48 48 $objQuery = new SC_Query_Ex(); 49 49 // メールテンプレート情報の取得 50 $where = "template_id = ?";51 $arrRet = $objQuery->select( "subject, header, footer", 'dtb_mailtemplate', $where, array($template_id));50 $where = 'template_id = ?'; 51 $arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id)); 52 52 $objPage->tpl_header = $arrRet[0]['header']; 53 53 $objPage->tpl_footer = $arrRet[0]['footer']; … … 63 63 // メール送信処理 64 64 $objSendMail = new SC_SendMail_Ex(); 65 if ($from_address == "") $from_address = $arrInfo['email03'];66 if ($from_name == "") $from_name = $arrInfo['shop_name'];67 if ($reply_to == "") $reply_to = $arrInfo['email03'];65 if ($from_address == '') $from_address = $arrInfo['email03']; 66 if ($from_name == '') $from_name = $arrInfo['shop_name']; 67 if ($reply_to == '') $reply_to = $arrInfo['email03']; 68 68 $error = $arrInfo['email04']; 69 69 $tosubject = $this->sfMakeSubject($tmp_subject, $objMailView); … … 75 75 76 76 /* 受注完了メール送信 */ 77 function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true) {77 function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = "", $send = true) { 78 78 79 79 $arrTplVar = new stdClass(); … … 83 83 $objQuery = new SC_Query_Ex(); 84 84 85 if ($subject == "" && $header == ""&& $footer == "") {85 if ($subject == '' && $header == '' && $footer == "") { 86 86 // メールテンプレート情報の取得 87 $where = "template_id = ?";88 $arrRet = $objQuery->select( "subject, header, footer", 'dtb_mailtemplate', $where, array($template_id));87 $where = 'template_id = ?'; 88 $arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id)); 89 89 $arrTplVar->tpl_header = $arrRet[0]['header']; 90 90 $arrTplVar->tpl_footer = $arrRet[0]['footer']; … … 97 97 98 98 // 受注情報の取得 99 $where = "order_id = ?";100 $arrRet = $objQuery->select( "*", 'dtb_order', $where, array($order_id));99 $where = 'order_id = ?'; 100 $arrRet = $objQuery->select('*', 'dtb_order', $where, array($order_id)); 101 101 $arrOrder = $arrRet[0]; 102 102 $objQuery->setOrder('order_detail_id'); 103 $arrTplVar->arrOrderDetail = $objQuery->select( "*", 'dtb_order_detail', $where, array($order_id));103 $arrTplVar->arrOrderDetail = $objQuery->select('*', 'dtb_order_detail', $where, array($order_id)); 104 104 105 105 $objProduct = new SC_Product_Ex(); 106 106 $objQuery->setOrder('shipping_id'); 107 $arrRet = $objQuery->select( "*", 'dtb_shipping', "order_id = ?", array($order_id));107 $arrRet = $objQuery->select('*', 'dtb_shipping', "order_id = ?", array($order_id)); 108 108 foreach (array_keys($arrRet) as $key) { 109 109 $objQuery->setOrder('shipping_id'); 110 $arrItems = $objQuery->select( "*", 'dtb_shipment_item', "order_id = ? AND shipping_id = ?",110 $arrItems = $objQuery->select('*', 'dtb_shipment_item', "order_id = ? AND shipping_id = ?", 111 111 array($order_id, $arrRet[$key]['shipping_id'])); 112 112 foreach ($arrItems as $itemKey => $arrDetail) { … … 126 126 $objQuery->setOrder('customer_id'); 127 127 $arrRet = $objQuery->select('point', 'dtb_customer', "customer_id = ?", array($customer_id)); 128 $arrCustomer = isset($arrRet[0]) ? $arrRet[0] : "";128 $arrCustomer = isset($arrRet[0]) ? $arrRet[0] : ''; 129 129 130 130 $arrTplVar->arrCustomer = $arrCustomer; … … 132 132 133 133 //その他決済情報 134 if ($arrOrder['memo02'] != "") {134 if ($arrOrder['memo02'] != '') { 135 135 $arrOther = unserialize($arrOrder['memo02']); 136 136 137 137 foreach ($arrOther as $other_key => $other_val) { 138 if (SC_Utils_Ex::sfTrim($other_val['value']) == "") {139 $arrOther[$other_key]['value'] = "";138 if (SC_Utils_Ex::sfTrim($other_val['value']) == '') { 139 $arrOther[$other_key]['value'] = ''; 140 140 } 141 141 } … … 236 236 $sqlval['send_date'] = 'CURRENT_TIMESTAMP'; 237 237 if (!isset($_SESSION['member_id'])) $_SESSION['member_id'] = ""; 238 if ($_SESSION['member_id'] != "") {238 if ($_SESSION['member_id'] != '') { 239 239 $sqlval['creator_id'] = $_SESSION['member_id']; 240 240 } else { … … 250 250 /* 会員登録があるかどうかのチェック(仮会員を含まない) */ 251 251 function sfCheckCustomerMailMaga($email) { 252 $col = "email, mailmaga_flg, customer_id";252 $col = 'email, mailmaga_flg, customer_id'; 253 253 $from = 'dtb_customer'; 254 $where = "(email = ? OR email_mobile = ?) AND status = 2 AND del_flg = 0";254 $where = '(email = ? OR email_mobile = ?) AND status = 2 AND del_flg = 0'; 255 255 $objQuery = new SC_Query_Ex(); 256 256 $arrRet = $objQuery->select($col, $from, $where, array($email)); … … 275 275 $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); 276 276 } else { 277 $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId('', "secret_key = ?", array($secret_key));277 $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId('', 'secret_key = ?', array($secret_key)); 278 278 } 279 279 if (SC_Utils_Ex::isBlank($arrCustomerData)) { … … 296 296 if (CUSTOMER_CONFIRM_MAIL == true and $arrCustomerData['status'] == 1) { 297 297 $subject = $objHelperMail->sfMakeSubject('会員登録のご確認', $objMailText); 298 $toCustomerMail = $objMailText->fetch( "mail_templates/customer_mail.tpl");298 $toCustomerMail = $objMailText->fetch('mail_templates/customer_mail.tpl'); 299 299 } else { 300 300 $subject = $objHelperMail->sfMakeSubject('会員登録のご完了', $objMailText); 301 $toCustomerMail = $objMailText->fetch( "mail_templates/customer_regist_mail.tpl");301 $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); 302 302 } 303 303 … … 347 347 348 348 // 表示順 349 $objQuery->setOrder( "create_date DESC");349 $objQuery->setOrder('create_date DESC'); 350 350 351 351 $arrResults = $objQuery->select('*', 'dtb_mailmaga_template', $where, $arrValues); … … 374 374 375 375 // 表示順 376 $objQuery->setOrder( "create_date DESC");376 $objQuery->setOrder('create_date DESC'); 377 377 378 378 $arrResults = $objQuery->select('*', 'dtb_send_history', $where, $arrValues); … … 414 414 // お名前の変換 415 415 $customerName = trim($arrDestination['name']); 416 $subjectBody = preg_replace( "/{name}/", $customerName, $arrMail['subject']);417 $mailBody = preg_replace( "/{name}/", $customerName, $arrMail['body']);416 $subjectBody = preg_replace('/{name}/', $customerName, $arrMail['subject']); 417 $mailBody = preg_replace('/{name}/', $customerName, $arrMail['body']); 418 418 419 419 $objMail->setItem( … … 459 459 460 460 // 送信完了 報告メール 461 $compSubject = date( "Y年m月d日H時i分") . " 下記メールの配信が完了しました。";461 $compSubject = date('Y年m月d日H時i分') . ' 下記メールの配信が完了しました。'; 462 462 // 管理者宛に変更 463 463 $objMail->setTo($objSite['email03']);
Note: See TracChangeset
for help on using the changeset viewer.
