- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Mail.php
r22584 r22796 29 29 * @version $Id$ 30 30 */ 31 class SC_Helper_Mail 32 { 31 class SC_Helper_Mail { 33 32 34 33 /** メールテンプレートのパス */ … … 45 44 * コンストラクタ. 46 45 */ 47 function __construct() 48 { 46 function __construct() { 49 47 $masterData = new SC_DB_MasterData_Ex(); 50 48 $this->arrMAILTPLPATH = $masterData->getMasterData('mtb_mail_tpl_path'); … … 57 55 * @param LC_Page $objPage 58 56 */ 59 function setPage(LC_Page $objPage) 60 { 57 function setPage(LC_Page $objPage) { 61 58 $this->objPage = $objPage; 62 59 } … … 67 64 * @return LC_Page 68 65 */ 69 function getPage() 70 { 66 function getPage() { 71 67 return $this->objPage; 72 68 } 73 69 74 70 /* DBに登録されたテンプレートメールの送信 */ 75 function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = '', $from_name = '', $reply_to = '', $bcc = '') 76 { 77 71 function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = '', $from_name = '', $reply_to = '', $bcc = '') { 72 73 $objQuery =& SC_Query_Ex::getSingletonInstance(); 78 74 // メールテンプレート情報の取得 79 $ objMailtemplate = new SC_Helper_Mailtemplate_Ex();80 $ mailtemplate = $objMailtemplate->get($template_id);81 $objPage->tpl_header = $ mailtemplate['header'];82 $objPage->tpl_footer = $ mailtemplate['footer'];83 $tmp_subject = $ mailtemplate['subject'];75 $where = 'template_id = ?'; 76 $arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id)); 77 $objPage->tpl_header = $arrRet[0]['header']; 78 $objPage->tpl_footer = $arrRet[0]['footer']; 79 $tmp_subject = $arrRet[0]['subject']; 84 80 85 81 $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); … … 105 101 106 102 /* 受注完了メール送信 */ 107 function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = '', $send = true) 108 { 103 function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = '', $send = true) { 109 104 110 105 $arrTplVar = new stdClass(); … … 116 111 if ($subject == '' && $header == '' && $footer == '') { 117 112 // メールテンプレート情報の取得 118 $ objMailtemplate = new SC_Helper_Mailtemplate_Ex();119 $ mailtemplate = $objMailtemplate->get($template_id);120 $arrTplVar->tpl_header = $ mailtemplate['header'];121 $arrTplVar->tpl_footer = $ mailtemplate['footer'];122 $tmp_subject = $ mailtemplate['subject'];113 $where = 'template_id = ?'; 114 $arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id)); 115 $arrTplVar->tpl_header = $arrRet[0]['header']; 116 $arrTplVar->tpl_footer = $arrRet[0]['footer']; 117 $tmp_subject = $arrRet[0]['subject']; 123 118 } else { 124 119 $arrTplVar->tpl_header = $header; … … 218 213 219 214 // テンプレートを使用したメールの送信 220 function sfSendTplMail($to, $tmp_subject, $tplpath, &$objPage) 221 { 215 function sfSendTplMail($to, $tmp_subject, $tplpath, &$objPage) { 222 216 $objMailView = new SC_SiteView_Ex(); 223 217 $objMailView->setPage($this->getPage()); … … 240 234 241 235 // 通常のメール送信 242 function sfSendMail($to, $tmp_subject, $body) 243 { 236 function sfSendMail($to, $tmp_subject, $body) { 244 237 $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); 245 238 // メール送信処理 … … 255 248 256 249 //件名にテンプレートを用いる 257 function sfMakeSubject($subject, &$objMailView) 258 { 250 function sfMakeSubject($subject, &$objMailView) { 259 251 if (empty($objMailView)) { 260 252 $objMailView = new SC_SiteView_Ex(); … … 275 267 276 268 // メール配信履歴への登録 277 function sfSaveMailHistory($order_id, $template_id, $subject, $body) 278 { 269 function sfSaveMailHistory($order_id, $template_id, $subject, $body) { 279 270 $sqlval = array(); 280 271 $sqlval['subject'] = $subject; … … 296 287 297 288 /* 会員登録があるかどうかのチェック(仮会員を含まない) */ 298 function sfCheckCustomerMailMaga($email) 299 { 289 function sfCheckCustomerMailMaga($email) { 300 290 $col = 'email, mailmaga_flg, customer_id'; 301 291 $from = 'dtb_customer'; … … 318 308 * @return boolean true:成功 false:失敗 319 309 */ 320 function sfSendRegistMail($secret_key, $customer_id = '', $is_mobile = false) 321 { 310 function sfSendRegistMail($secret_key, $customer_id = '', $is_mobile = false) { 322 311 // 会員データの取得 323 312 if (SC_Utils_Ex::sfIsInt($customer_id)) { … … 382 371 * @todo 表示順も引数で変更できるように 383 372 */ 384 function sfGetMailmagaTemplate($template_id = null) 385 { 373 function sfGetMailmagaTemplate($template_id = null) { 386 374 // 初期化 387 375 $where = ''; … … 409 397 * @return array 送信履歴情報を格納した配列 410 398 */ 411 function sfGetSendHistory($send_id = null) 412 { 399 function sfGetSendHistory($send_id = null) { 413 400 // 初期化 414 401 $where = ''; … … 438 425 * @return void 439 426 */ 440 function sfSendMailmagazine($send_id) 441 { 427 function sfSendMailmagazine($send_id) { 442 428 $objQuery =& SC_Query_Ex::getSingletonInstance(); 443 429 $objDb = new SC_Helper_DB_Ex();
Note: See TracChangeset
for help on using the changeset viewer.