/** * 正会員登録完了メール送信 * * @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のメルマガ配送を行う * * @param integer $send_id dtb_send_history の情報 * @return void */ function sfSendMailmagazine($send_id) { $objQuery =& SC_Query_Ex::getSingletonInstance(); $objDb = new SC_Helper_DB_Ex(); $objSite = $objDb->sfGetBasisData(); $objMail = new SC_SendMail_Ex(); $where = 'del_flg = 0 AND send_id = ?'; $arrMail = $objQuery->getRow('*', 'dtb_send_history', $where, array($send_id)); // 対象となる$send_idが見つからない if (SC_Utils_Ex::isBlank($arrMail)) { return; } // 送信先リストの取得 $arrDestinationList = $objQuery->select('*', 'dtb_send_customer', 'send_id = ? AND (send_flag = 2 OR send_flag IS NULL)', array($send_id)); // 現在の配信数 $complete_count = $arrMail['complete_count']; if (SC_Utils_Ex::isBlank($arrMail)) { $complete_count = 0; } foreach ($arrDestinationList as $arrDestination) { // お名前の変換 $customerName = trim($arrDestination['name']); $subjectBody = preg_replace("/{name}/", $customerName, $arrMail['subject']); $mailBody = preg_replace("/{name}/", $customerName, $arrMail['body']); $objMail->setItem($arrDestination['email'], $subjectBody, $mailBody, $objSite["email03"], $objSite["shop_name"], $objSite["email03"], $objSite["email04"], $objSite["email04"]); // テキストメール配信の場合 if ($arrMail["mail_method"] == 2) { $sendResut = $objMail->sendMail(); // HTMLメール配信の場合 } else { $sendResut = $objMail->sendHtmlMail(); } // 送信完了なら1、失敗なら2をメール送信結果フラグとしてDBに挿入 if (!$sendResut) { $sendFlag = '2'; } else { // 完了を 1 増やす $sendFlag = '1'; $complete_count++; } // 送信結果情報を更新 $objQuery->update('dtb_send_customer', array('send_flag' => $sendFlag), 'send_id = ? AND customer_id = ?', array($send_id, $arrDestination["customer_id"])); } // メール全件送信完了後の処理 $objQuery->update('dtb_send_history', array('end_date' => 'CURRENT_TIMESTAMP', 'complete_count' => $complete_count), 'send_id = ?', array($send_id)); // 送信完了 報告メール $compSubject = date("Y年m月d日H時i分") . " 下記メールの配信が完了しました。"; // 管理者宛に変更 $objMail->setTo($objSite["email03"]); $objMail->setSubject($compSubject); // テキストメール配信の場合 if ($arrMail["mail_method"] == 2) { $sendResut = $objMail->sendMail(); // HTMLメール配信の場合 } else { $sendResut = $objMail->sendHtmlMail(); } return; }
/** * 会員登録完了メール送信する * * @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(); }
function sfSendMail($to, $subject, $body) { $objSiteInfo = new SC_SiteInfo(); $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(); }
/** * 会員登録完了メール送信する * * @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 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; }