Skip to content

Commit

Permalink
レビュー指摘事項を反映
Browse files Browse the repository at this point in the history
  • Loading branch information
shinya committed Jun 2, 2023
1 parent f47cab9 commit 91cfe02
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Mypage/ChangeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ChangeController extends AbstractController
/**
* @var baseInfoRepository
*/
protected $baseInfoRepository;
protected $baseInfoRepository;

private const SESSION_KEY_PRE_EMAIL = 'eccube.front.mypage.change.preEmail';

Expand Down
5 changes: 1 addition & 4 deletions src/Eccube/Controller/ShippingMultipleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,12 @@ public function shippingMultipleEdit(Request $request)
}

// 会員情報変更時にメールを送信
if($this->baseInfoRepository->get()->isOptionMailNotifier()) {
$Customer = $this->getUser();

if ($this->baseInfoRepository->get()->isOptionMailNotifier()) {
// 情報のセット
$userData['userAgent'] = $request->headers->get('User-Agent');
$userData['ipAddress'] = $request->getClientIp();

$this->mailService->sendCustomerChangeNotifyMail($Customer, $userData, trans('front.mypage.delivery.notify_title'));

}

$CustomerAddress->setCustomer($Customer);
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/ShoppingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public function shippingEdit(Request $request, Shipping $Shipping)
}

// 会員情報変更時にメールを送信
if($this->baseInfoRepository->get()->isOptionMailNotifier()) {
if ($this->baseInfoRepository->get()->isOptionMailNotifier()) {
$Customer = $this->getUser();

// 情報のセット
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ id,creator_id,name,file_name,mail_subject,create_date,update_date,discriminator_
6,,Password Reset,Mail/forgot_mail.twig,Reset your password,2017-03-07 10:14:52,2017-03-07 10:14:52,mailtemplate
7,,Password Reminder,Mail/reset_complete_mail.twig,Your password has been changed,2017-03-07 10:14:52,2017-03-07 10:14:52,mailtemplate
8,,Shipping Notice,Mail/shipping_notify.twig,Your order has been shipped,2017-03-07 10:14:52,2017-03-07 10:14:52,mailtemplate
9,,Notification email,Mail/customer_change_notify.twig,[eventName] notification,2017-03-07 10:14:52,2017-03-07 10:14:52,mailtemplate
9,,Notification email,Mail/customer_change_notify.twig,Your account information has been changed.,2017-03-07 10:14:52,2017-03-07 10:14:52,mailtemplate
2 changes: 1 addition & 1 deletion src/Eccube/Service/MailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ public function sendCustomerChangeNotifyMail(Customer $Customer, array $userData
}

// メールアドレスの変更があった場合、変更前のメールアドレスにも送信
if (!is_null($userData['preEmail']) && $Customer->getEmail() != $userData['preEmail']) {
if (isset($userData['preEmail']) && $Customer->getEmail() != $userData['preEmail']) {
$message->to($this->convertRFCViolatingEmail($userData['preEmail']));

// メール送信
Expand Down
3 changes: 1 addition & 2 deletions tests/Eccube/Tests/Service/MailServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ public function testCustomerChangeNotifyMailByDeliveryAddressChange()
{
$userData = [
'userAgent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
'ipAddress' => '192.168.0.100',
'preEmail' => $this->Customer->getEmail(),
'ipAddress' => '192.168.0.100'
];
$eventName = 'お届け先情報編集';

Expand Down

0 comments on commit 91cfe02

Please sign in to comment.