/** * パスワード変更お知らせメールを送信する. * * @param array $CONF 店舗基本情報の配列 * @param string $email 送信先メールアドレス * @param string $customer_name 送信先氏名 * @param string $new_password 変更後の新パスワード * @return void * * FIXME: メールテンプレート編集の方に足すのが望ましい */ public function lfSendMail(&$CONF, $email, $customer_name, $new_password) { // パスワード変更お知らせメール送信 $objMailText = new SiteView(false); $objMailText->setPage($this); $objMailText->assign('customer_name', $customer_name); $objMailText->assign('new_password', $new_password); $toCustomerMail = $objMailText->fetch('mail_templates/forgot_mail.tpl'); /* @var $objHelperMail MailHelper */ $objHelperMail = Application::alias('eccube.helper.mail'); $objHelperMail->setPage($this); // メール送信オブジェクトによる送信処理 /* @var $objMail Sendmail */ $objMail = Application::alias('eccube.sendmail'); $objMail->setItem('', $objHelperMail->sfMakeSubject('パスワードを変更いたしました。'), $toCustomerMail, $CONF['email03'], $CONF['shop_name'], $CONF['email03'], $CONF['email04'], $CONF['email04']); $objMail->setTo($email, $customer_name . ' 様'); $objMail->sendMail(); return; }
/** * 会員登録完了メール送信する * * @access private * @return void */ public function lfSendMail($uniqid, $arrForm) { $CONF = Application::alias('eccube.helper.db')->getBasisData(); $objMailText = new SiteView(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrForm['name01']); $objMailText->assign('name02', $arrForm['name02']); $objMailText->assign('uniqid', $uniqid); $objMailText->assignobj($this); /* @var $objHelperMail MailHelper */ $objHelperMail = Application::alias('eccube.helper.mail'); $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'); } /* @var $objMail Sendmail */ $objMail = Application::alias('eccube.sendmail'); $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(); }
/** * @param SiteView $objMailView */ public function sfMakeSubject($subject, &$objMailView = NULL) { if (empty($objMailView)) { $objMailView = new SiteView(); $objMailView->setPage($this->getPage()); } $objTplAssign = new \stdClass(); $arrInfo = Application::alias('eccube.helper.db')->getBasisData(); $objTplAssign->tpl_shopname = $arrInfo['shop_name']; $objTplAssign->tpl_infoemail = $subject; // 従来互換 $objTplAssign->tpl_mailtitle = $subject; $objMailView->assignobj($objTplAssign); $subject = $objMailView->fetch('mail_templates/mail_title.tpl'); // #1940 (MailHelper#sfMakeSubject 先頭に改行を含む値を返す) 対応 $subject = trim($subject); return $subject; }
/** * 正会員登録完了メール送信 * * @param string $registSecretKey * @access private * @return void */ public function lfSendRegistMail($registSecretKey) { $objQuery = Application::alias('eccube.query'); /* @var $objCustomer Customer */ $objCustomer = Application::alias('eccube.customer'); /* @var $objHelperMail MailHelper */ $objHelperMail = Application::alias('eccube.helper.mail'); $objHelperMail->setPage($this); $CONF = Application::alias('eccube.helper.db')->getBasisData(); //-- 会員データを取得 $arrCustomer = $objQuery->select('*', 'dtb_customer', 'secret_key = ?', array($registSecretKey)); $data = $arrCustomer[0]; $objCustomer->setLogin($data['email']); //-- メール送信 $objMailText = new SiteView(); $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('会員登録が完了しました。'); /* @var $objMail Sendmail */ $objMail = Application::alias('eccube.sendmail'); $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(); }