/** * メールの送信を行う。 * * @return void */ function lfSendMail(&$objPage) { $CONF = SC_Helper_DB_Ex::sfGetBasisData(); $objPage->tpl_shopname = $CONF['shop_name']; $objPage->tpl_infoemail = $CONF['email02']; $helperMail = new SC_Helper_Mail_Ex(); $helperMail->setPage($this); $helperMail->sfSendTemplateMail($objPage->arrForm['email']['value'], $objPage->arrForm['name01']['value'] . ' 様', 5, $objPage, $CONF['email03'], $CONF['shop_name'], $CONF['email02'], $CONF['email02']); }
/** * 正会員登録完了メール送信 * * @param string $registSecretKey * @access private * @return void */ public function lfSendRegistMail($registSecretKey) { $objQuery = SC_Query_Ex::getSingletonInstance(); $objCustomer = new SC_Customer_Ex(); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); $CONF = SC_Helper_DB_Ex::sfGetBasisData(); //-- 会員データを取得 $arrCustomer = $objQuery->select('*', 'dtb_customer', 'secret_key = ?', array($registSecretKey)); $data = $arrCustomer[0]; $objCustomer->setLogin($data['email']); //-- メール送信 $objMailText = new SC_SiteView_Ex(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $data['name01']); $objMailText->assign('name02', $data['name02']); $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); $subject = $objHelperMail->sfMakesubject('会員登録が完了しました。'); $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04']); // 宛先の設定 $name = $data['name01'] . $data['name02'] . ' 様'; $objMail->setTo($data['email'], $name); $objMail->sendMail(); }
/** * パスワード変更お知らせメールを送信する. * * @param array $CONF 店舗基本情報の配列 * @param string $email 送信先メールアドレス * @param string $customer_name 送信先氏名 * @param string $new_password 変更後の新パスワード * @return void * * FIXME: メールテンプレート編集の方に足すのが望ましい */ function lfSendMail(&$CONF, $email, $customer_name, $new_password) { // パスワード変更お知らせメール送信 $objMailText = new SC_SiteView_Ex(false); $objMailText->setPage($this); $objMailText->assign('customer_name', $customer_name); $objMailText->assign('new_password', $new_password); $toCustomerMail = $objMailText->fetch('mail_templates/forgot_mail.tpl'); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); // メール送信オブジェクトによる送信処理 $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $objHelperMail->sfMakeSubject('パスワードを変更いたしました。'), $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04']); $objMail->setTo($email, $customer_name . ' 様'); $objMail->sendMail(); return; }
/** * 注文受付メールを送信する. * * 端末種別IDにより, 携帯電話の場合は携帯用の文面, * それ以外の場合は PC 用の文面でメールを送信する. * * @param integer $order_id 受注ID * @param object $objPage LC_Page インスタンス * @return boolean 送信に成功したか。現状では、正確には取得できない。 */ public static function sendOrderMail($order_id, &$objPage = NULL) { $objMail = new SC_Helper_Mail_Ex(); // setPageは、プラグインの処理に必要(see #1798) if (is_object($objPage)) { $objMail->setPage($objPage); } $arrOrder = SC_Helper_Purchase::getOrder($order_id); if (empty($arrOrder)) { return false; // 失敗 } $template_id = $arrOrder['device_type_id'] == DEVICE_TYPE_MOBILE ? 2 : 1; $objMail->sfSendOrderMail($order_id, $template_id); return true; // 成功 }
/** * 会員に登録メールを再送する処理 * * @param integer $customer_id 会員ID * @return boolean true:成功 false:失敗 */ public function lfDoResendMail($customer_id) { $arrData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); if (SC_Utils_Ex::isBlank($arrData) or $arrData['del_flg'] == 1) { //対象となるデータが見つからない、または削除済み return false; } //仮登録メール再送 $resend_flg = true; // 登録メール再送 $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); $objHelperMail->sfSendRegistMail($arrData['secret_key'], $customer_id, null, $resend_flg); return true; }
/** * Page のアクション. * * @return void */ function action() { $objCartSess = new SC_CartSession_Ex(); $objSiteSess = new SC_SiteSession_Ex(); $objCustomer = new SC_Customer_Ex(); $objQuery =& SC_Query_Ex::getSingletonInstance(); $objPurchase = new SC_Helper_Purchase_Ex(); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); $this->is_multiple = $objPurchase->isMultiple(); // 前のページで正しく登録手続きが行われた記録があるか判定 if (!$objSiteSess->isPrePage()) { SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess); } // ユーザユニークIDの取得と購入状態の正当性をチェック $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); $this->cartKey = $objCartSess->getKey(); // カート内商品のチェック $this->tpl_message = $objCartSess->checkProducts($this->cartKey); if (!SC_Utils_Ex::isBlank($this->tpl_message)) { SC_Response_Ex::sendRedirect(CART_URLPATH); SC_Response_Ex::actionExit(); } // カートの商品を取得 $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple); $this->arrCartItems = $objCartSess->getCartList($this->cartKey); // 合計金額 $this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey); // 税額 $this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey); // ポイント合計 $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey); // 一時受注テーブルの読込 $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); // カート集計を元に最終計算 $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, $arrOrderTemp['use_point'], $objPurchase->getShippingPref($this->is_multiple), $arrOrderTemp['charge'], $arrOrderTemp['discount'], $arrOrderTemp['deliv_id']); $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); // 会員ログインチェック if ($objCustomer->isLoginSuccess(true)) { $this->tpl_login = '******'; $this->tpl_user_point = $objCustomer->getValue('point'); } // 決済モジュールを使用するかどうか $this->use_module = $this->useModule($this->arrForm['payment_id']); switch ($this->getMode()) { // 前のページに戻る case 'return': // 正常な推移であることを記録しておく $objSiteSess->setRegistFlag(); SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); SC_Response_Ex::actionExit(); break; case 'confirm': /* * 決済モジュールで必要なため, 受注番号を取得 */ $this->arrForm['order_id'] = $objQuery->nextval('dtb_order_order_id'); $_SESSION['order_id'] = $this->arrForm['order_id']; // 集計結果を受注一時テーブルに反映 $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, $objCustomer); // 正常に登録されたことを記録しておく $objSiteSess->setRegistFlag(); // 決済モジュールを使用する場合 if ($this->use_module) { $objPurchase->completeOrder(ORDER_PENDING); SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH); } else { $objPurchase->completeOrder(ORDER_NEW); $template_id = SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE ? 2 : 1; $objHelperMail->sfSendOrderMail($this->arrForm['order_id'], $template_id); SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH); } SC_Response_Ex::actionExit(); break; default: break; } }
/** * 会員登録完了メール送信する * * @access private * @return void */ public function lfSendMail($uniqid, $arrForm) { $CONF = SC_Helper_DB_Ex::sfGetBasisData(); $objMailText = new SC_SiteView_Ex(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrForm['name01']); $objMailText->assign('name02', $arrForm['name02']); $objMailText->assign('uniqid', $uniqid); $objMailText->assignobj($this); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); // 仮会員が有効の場合 if (CUSTOMER_CONFIRM_MAIL == true) { $subject = $objHelperMail->sfMakeSubject('会員登録のご確認'); $toCustomerMail = $objMailText->fetch('mail_templates/customer_mail.tpl'); } else { $subject = $objHelperMail->sfMakeSubject('会員登録のご完了'); $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); } $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04'], $CONF['email01']); // 宛先の設定 $objMail->setTo($arrForm['email'], $arrForm['name01'] . $arrForm['name02'] . ' 様'); $objMail->sendMail(); }
/** * 会員登録完了メール送信する * * @access private * @return void */ function lfSendMail($uniqid, $arrForm) { $CONF = SC_Helper_DB_Ex::sfGetBasisData(); $objMailText = new SC_SiteView_Ex(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrForm['name01']); $objMailText->assign('name02', $arrForm['name02']); $objMailText->assign('uniqid', $uniqid); $objMailText->assignobj($this); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); // 仮会員が有効の場合 if (CUSTOMER_CONFIRM_MAIL == true) { $subject = $objHelperMail->sfMakeSubject(t('c_Confirmation of member registration_02')); $toCustomerMail = $objMailText->fetch('mail_templates/customer_mail.tpl'); } else { $subject = $objHelperMail->sfMakeSubject(t('c_Completion of member registration_02')); $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); } $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04'], $CONF['email01']); // 宛先の設定 $objMail->setTo($arrForm['email'], t('f_NAME_FULL_SIR_01', array('T_ARG1' => $arrForm['name01'], 'T_ARG2' => $arrForm['name02']))); $objMail->sendMail(); }
/** * 退会手続き完了メール送信する * * @access private * @param integer $customer_id 会員ID * @return void */ public function lfSendRefusalMail($customer_id) { // 会員データの取得 if (SC_Utils_Ex::sfIsInt($customer_id)) { $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); } if (SC_Utils_Ex::isBlank($arrCustomerData)) { return false; } $CONF = SC_Helper_DB_Ex::sfGetBasisData(); $objMailText = new SC_SiteView_Ex(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrCustomerData['name01']); $objMailText->assign('name02', $arrCustomerData['name02']); $objMailText->assignobj($this); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); $subject = $objHelperMail->sfMakeSubject('退会手続きのご完了', $objMailText); $toCustomerMail = $objMailText->fetch('mail_templates/customer_refusal_mail.tpl'); $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $subject, $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04'], $CONF['email01']); $objMail->setTo($arrCustomerData['email'], $arrCustomerData['name01'] . $arrCustomerData['name02'] . ' 様'); $objMail->sendMail(); }
/** * 確認画面を表示する為の準備 * @param SC_FormParam $objFormParam */ function confirm(&$objFormParam) { $arrErr = $objFormParam->checkerror(); // メールの送信 if (count($arrErr) == 0) { // 注文受付メール(送信なし) $objMail = new SC_Helper_Mail_Ex(); $objMail->setPage($this); $objSendMail = $objMail->sfSendOrderMail($objFormParam->getValue('order_id'), $objFormParam->getValue('template_id'), $objFormParam->getValue('subject'), $objFormParam->getValue('header'), $objFormParam->getValue('footer'), false); $this->tpl_subject = $objFormParam->getValue('subject'); $this->tpl_body = mb_convert_encoding($objSendMail->body, CHAR_CODE, 'auto'); $this->tpl_to = $objSendMail->tpl_to; $this->tpl_mainpage = 'order/mail_confirm.tpl'; return true; } return $arrErr; }
/** * パスワード変更お知らせメールを送信する. * * @param array $CONF 店舗基本情報の配列 * @param string $email 送信先メールアドレス * @param string $customer_name 送信先氏名 * @param string $new_password 変更後の新パスワード * @return void * * FIXME: メールテンプレート編集の方に足すのが望ましい */ function lfSendMail(&$CONF, $email, $customer_name, $new_password) { // パスワード変更お知らせメール送信 $objMailText = new SC_SiteView_Ex(false); $objMailText->setPage($this); $objMailText->assign('customer_name', $customer_name); $objMailText->assign('new_password', $new_password); $toCustomerMail = $objMailText->fetch('mail_templates/forgot_mail.tpl'); $objHelperMail = new SC_Helper_Mail_Ex(); $objHelperMail->setPage($this); // メール送信オブジェクトによる送信処理 $objMail = new SC_SendMail_Ex(); $objMail->setItem('', $objHelperMail->sfMakeSubject(t('c_The password has been changed._01')), $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04']); $objMail->setTo($email, t('f_LAST_NAME_SIR_01', array('T_ARG1' => $customer_name))); $objMail->sendMail(); return; }