/** * Send password reset notification mail. * * @param $Customer 会員情報 */ public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password) { $body = $this->app->renderView('Mail/reset_complete_mail.twig', array('Customer' => $Customer, 'password' => $password)); $message = \Swift_Message::newInstance()->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ')->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))->setTo(array($Customer->getEmail()))->setBcc($this->BaseInfo->getEmail01())->setReplyTo($this->BaseInfo->getEmail03())->setReturnPath($this->BaseInfo->getEmail04())->setBody($body); $event = new EventArgs(array('message' => $message, 'Customer' => $Customer, 'BaseInfo' => $this->BaseInfo, 'password' => $password), null); $this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_PASSWORD_RESET_COMPLETE, $event); $this->app->mail($message); }
protected function createSendCustomer(\Plugin\MailMagazine\Entity\MailMagazineSendHistory $SendHistory, \Eccube\Entity\Customer $MailCustomer) { // ----------------------------- // plg_send_customer // ----------------------------- $sendId = $SendHistory->getId(); // Entity $SendCustomer = new MailMagazineSendCustomer(); // data $SendCustomer->setSendId($sendId); $SendCustomer->setCustomerId($MailCustomer->getId()); $SendCustomer->setEmail($MailCustomer->getEmail()); $SendCustomer->setName($MailCustomer->getName01() . " " . $MailCustomer->getName02()); $this->app['eccube.plugin.mail_magazine.repository.mail_magazine_send_customer']->updateSendCustomer($SendCustomer); return $SendCustomer; }
/** * Send password reset notification mail. * * @param $Customer 会員情報 */ public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password) { $body = $this->app->renderView('Mail/reset_complete_mail.twig', array('Customer' => $Customer, 'password' => $password)); $message = \Swift_Message::newInstance()->setSubject('[' . $this->BaseInfo->getShopName() . '] パスワード変更のお知らせ')->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))->setTo(array($Customer->getEmail()))->setBcc($this->BaseInfo->getEmail01())->setReplyTo($this->BaseInfo->getEmail03())->setReturnPath($this->BaseInfo->getEmail04())->setBody($body); $this->app->mail($message); }
/** * ユーザはクーポン1回のみ利用できる * * @param $couponCd * @param $orderId * @param Customer $Customer * @return bool */ public function checkCouponUsedOrNotBefore($couponCd, $orderId, Customer $Customer) { $repository = $this->app['eccube.plugin.coupon.repository.coupon_order']; if ($this->app->isGranted('ROLE_USER')) { $CouponOrders = $repository->findUseCouponBefore($couponCd, $orderId, $Customer->getId()); } else { $CouponOrders = $repository->findUseCouponBefore($couponCd, $orderId, $Customer->getEmail()); } if ($CouponOrders) { // 存在すれば既に受注として利用されていないかチェック foreach ($CouponOrders as $CouponOrder) { $Order = $this->app['eccube.repository.order']->find($CouponOrder->getOrderId()); if ($Order) { if ($Order->getOrderStatus()->getId() != $this->app['config']['order_processing']) { // 同一のクーポンコードで既に受注データが存在している return true; } } } } return false; }