Source for file SC_Helper_Mail.php
Documentation is available at SC_Helper_Mail.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* @author LOCKON CO.,LTD.
$masterData = new SC_DB_MasterData_Ex();
$this->arrMAILTPLPATH = $masterData->getMasterData("mtb_mail_tpl_path");
$this->arrPref = $masterData->getMasterData("mtb_pref",
array("pref_id", "pref_name", "rank"));
/* DBに登録されたテンプレートメールの送信 */
function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = "", $from_name = "", $reply_to = "") {
$where = "template_id = ?";
$arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id));
$objPage->tpl_header = $arrRet[0]['header'];
$objPage->tpl_footer = $arrRet[0]['footer'];
$tmp_subject = $arrRet[0]['subject'];
$arrInfo = $objSiteInfo->data;
$objMailView->assignobj($objPage);
$objSendMail = new SC_SendMail_Ex();
$from = $arrInfo['email03'];
if ($from_address == "") $from_address = $arrInfo['email03'];
if ($from_name == "") $from_name = $arrInfo['shop_name'];
if ($reply_to == "") $reply_to = $arrInfo['email03'];
$error = $arrInfo['email04'];
$tosubject = $tmp_subject;
$objSendMail->setItem('', $tosubject, $body, $from_address, $from_name, $reply_to, $error, $error);
$objSendMail->setTo($to, $to_name);
$objSendMail->sendMail(); // メール送信
function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true) {
$arrInfo = $objSiteInfo->data;
$objPage->arrInfo = $arrInfo;
if($subject == "" && $header == "" && $footer == "") {
$where = "template_id = ?";
$arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id));
$objPage->tpl_header = $arrRet[0]['header'];
$objPage->tpl_footer = $arrRet[0]['footer'];
$tmp_subject = $arrRet[0]['subject'];
$objPage->tpl_header = $header;
$objPage->tpl_footer = $footer;
$arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id));
$arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id));
$objPage->Message_tmp = $arrOrder['message'];
$customer_id = $arrOrder['customer_id'];
$arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id));
$arrCustomer = isset ($arrRet[0]) ? $arrRet[0] : "";
$objPage->arrCustomer = $arrCustomer;
$objPage->arrOrder = $arrOrder;
if($arrOrder['memo02'] != "") {
foreach($arrOther as $other_key => $other_val){
if(SC_Utils_Ex::sfTrim($other_val["value"]) == ""){
$arrOther[$other_key]["value"] = "";
$objPage->arrOther = $arrOther;
$objPage->arrOrder['deliv_pref'] = $this->arrPref[$objPage->arrOrder['deliv_pref']];
$objPage->arrOrderDetail = $arrOrderDetail;
$objPage->tpl_user_point = $objCustomer->getValue('point');
$objMailView->assignobj($objPage);
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " ". $arrOrder["order_name02"] . " 様");
if ($objSendMail->sendMail()) {
$arrInfo = $objSiteInfo->data;
$objPage->tpl_shopname= $arrInfo['shop_name'];
$objPage->tpl_infoemail = $arrInfo['email02'];
$objMailView->assignobj($objPage);
$body = $objMailView->fetch($tplpath);
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$objSendMail->setItem($to, $subject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->sendMail();
$arrInfo = $objSiteInfo->data;
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$objSendMail->setItem($to, $subject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->sendMail();
function sfMakeSubject(&$objQuery, &$objMailView, &$objPage, $subject){
$arrInfo = $objQuery->select("*","dtb_baseinfo");
$objPage->tpl_shopname= $arrInfo['shop_name'];
$objPage->tpl_infoemail= $subject;
$objMailView->assignobj($objPage);
$mailtitle = $objMailView->fetch('mail_templates/mail_title.tpl');
$ret = $mailtitle. $subject;
$sqlval['subject'] = $subject;
$sqlval['order_id'] = $order_id;
$sqlval['template_id'] = $template_id;
$sqlval['send_date'] = "Now()";
if (!isset ($_SESSION['member_id'])) $_SESSION['member_id'] = "";
if($_SESSION['member_id'] != "") {
$sqlval['creator_id'] = $_SESSION['member_id'];
$sqlval['creator_id'] = '0';
$sqlval['mail_body'] = $body;
$objQuery->insert("dtb_mail_history", $sqlval);
/* 会員登録があるかどうかのチェック(仮会員を含まない) */
$col = "email, mailmaga_flg, customer_id";
$where = "(email = ? OR email_mobile = ?) AND status = 2 AND del_flg = 0";
$arrRet = $objQuery->select($col, $from, $where, array($email));
if(!empty($arrRet[0]['customer_id'])) {
Documentation generated on Fri, 24 Feb 2012 14:00:15 +0900 by Seasoft
|