Skip to content

Commit

Permalink
Merge pull request #1 from seasoftjapan/982-add
Browse files Browse the repository at this point in the history
EC-CUBE#989 不具合回避案
  • Loading branch information
clicktx authored Sep 6, 2024
2 parents f7262f2 + f14ed09 commit f85e954
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 76 deletions.
8 changes: 5 additions & 3 deletions data/class/helper/SC_Helper_Mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function sfCheckCustomerMailMaga($email)
/**
* 登録メールを送信する。
*
* @param string $secret_key 会員固有キー
* @param string $secret_key 会員固有キー。$customer_id に有効な数値が指定されると、無視される。
* @param integer $customer_id 会員ID
* @param boolean $is_mobile false(default):PCアドレスにメールを送る true:携帯アドレスにメールを送る
* @param $resend_flg true 仮登録メール再送
Expand Down Expand Up @@ -380,8 +380,10 @@ public function sfSendRegistMail($secret_key, $customer_id = '', $is_mobile = fa
$objMailText->assign('uniqid', $arrCustomerData['secret_key']);

$objHelperMail = new SC_Helper_Mail_Ex();
// 仮会員が有効の場合
if (CUSTOMER_CONFIRM_MAIL == true and $arrCustomerData['status'] == 1 or $arrCustomerData['status'] == 1 and $resend_flg == true) {
// 仮会員が有効の場合 (FIXME: コメント不正確)
if ($arrCustomerData['status'] == 1
&& (CUSTOMER_CONFIRM_MAIL == true || $resend_flg == true)
) {
$subject = $objHelperMail->sfMakeSubject('会員登録のご確認', $objMailText);
$toCustomerMail = $objMailText->fetch('mail_templates/customer_mail.tpl');
} else {
Expand Down
7 changes: 4 additions & 3 deletions data/class/pages/admin/customer/LC_Page_Admin_Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ public function lfDoResendMail($customer_id)
//対象となるデータが見つからない、または削除済み
return false;
}
//仮登録メール再送
$resend_flg = true;
// 登録メール再送

// 仮登録メール送信
$objHelperMail = new SC_Helper_Mail_Ex();
$objHelperMail->setPage($this);
$resend_flg = true;
$objHelperMail->sfSendRegistMail($arrData['secret_key'], $customer_id, null, $resend_flg);

return true;
}

Expand Down
39 changes: 3 additions & 36 deletions data/class/pages/entry/LC_Page_Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,44 +222,11 @@ public function lfMakeSqlVal(&$objFormParam)
*/
public function lfSendMail($uniqid, $arrForm)
{
$CONF = SC_Helper_DB_Ex::sfGetBasisData();
$objHelperMail = new SC_Helper_Mail_Ex();

$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);

$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'], // reply_to
$CONF['email04'], // return_path
$CONF['email04'], // Errors_to
$CONF['email01'] // Bcc
);
// 宛先の設定
$objMail->setTo($arrForm['email'],
$arrForm['name01'] . $arrForm['name02'] .'');

$objMail->sendMail();
$resend_flg = true;
$objHelperMail->sfSendRegistMail($uniqid, '', false, $resend_flg);
}

/**
Expand Down
37 changes: 3 additions & 34 deletions data/class/pages/regist/LC_Page_Regist.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,40 +135,9 @@ public function lfCheckError($array)
*/
public function lfSendRegistMail($registSecretKey)
{
$objQuery = SC_Query_Ex::getSingletonInstance();
$objCustomer = new SC_Customer_Ex();
$objHelperMail = new SC_Helper_Mail_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'], // reply_to
$CONF['email04'], // return_path
$CONF['email04'] // Errors_to
);
// 宛先の設定
$name = $data['name01'] . $data['name02'] .'';
$objMail->setTo($data['email'], $name);
$objMail->sendMail();
$objHelperMail->sfSendRegistMail($registSecretKey);
}
}

0 comments on commit f85e954

Please sign in to comment.