|
@@ 104-157 (lines=54) @@
|
| 101 |
|
* @param $Customer 会員情報 |
| 102 |
|
* @param string $activateUrl アクティベート用url |
| 103 |
|
*/ |
| 104 |
|
public function sendCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl) |
| 105 |
|
{ |
| 106 |
|
log_info('仮会員登録メール送信開始'); |
| 107 |
|
|
| 108 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_entry_confirm_mail_template_id']); |
| 109 |
|
|
| 110 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 111 |
|
'Customer' => $Customer, |
| 112 |
|
'BaseInfo' => $this->BaseInfo, |
| 113 |
|
'activateUrl' => $activateUrl, |
| 114 |
|
]); |
| 115 |
|
|
| 116 |
|
$message = (new \Swift_Message()) |
| 117 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 118 |
|
->setFrom([$this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()]) |
| 119 |
|
->setTo([$Customer->getEmail()]) |
| 120 |
|
->setBcc($this->BaseInfo->getEmail01()) |
| 121 |
|
->setReplyTo($this->BaseInfo->getEmail03()) |
| 122 |
|
->setReturnPath($this->BaseInfo->getEmail04()); |
| 123 |
|
|
| 124 |
|
// HTMLテンプレートが存在する場合 |
| 125 |
|
$htmlFileName = $this->getHtmlTemplate($MailTemplate->getFileName()); |
| 126 |
|
if (!is_null($htmlFileName)) { |
| 127 |
|
$htmlBody = $this->twig->render($htmlFileName, [ |
| 128 |
|
'Customer' => $Customer, |
| 129 |
|
'BaseInfo' => $this->BaseInfo, |
| 130 |
|
'activateUrl' => $activateUrl, |
| 131 |
|
]); |
| 132 |
|
|
| 133 |
|
$message |
| 134 |
|
->setContentType('text/plain; charset=UTF-8') |
| 135 |
|
->setBody($body, 'text/plain') |
| 136 |
|
->addPart($htmlBody, 'text/html'); |
| 137 |
|
} else { |
| 138 |
|
$message->setBody($body); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
$event = new EventArgs( |
| 142 |
|
[ |
| 143 |
|
'message' => $message, |
| 144 |
|
'Customer' => $Customer, |
| 145 |
|
'BaseInfo' => $this->BaseInfo, |
| 146 |
|
'activateUrl' => $activateUrl, |
| 147 |
|
], |
| 148 |
|
null |
| 149 |
|
); |
| 150 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_CUSTOMER_CONFIRM, $event); |
| 151 |
|
|
| 152 |
|
$count = $this->mailer->send($message, $failures); |
| 153 |
|
|
| 154 |
|
log_info('仮会員登録メール送信完了', ['count' => $count]); |
| 155 |
|
|
| 156 |
|
return $count; |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
/** |
| 160 |
|
* Send customer complete mail. |
|
@@ 425-479 (lines=55) @@
|
| 422 |
|
* @param $Customer 会員情報 |
| 423 |
|
* @param string $activateUrl アクティベート用url |
| 424 |
|
*/ |
| 425 |
|
public function sendAdminCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl) |
| 426 |
|
{ |
| 427 |
|
log_info('仮会員登録再送メール送信開始'); |
| 428 |
|
|
| 429 |
|
/* @var $MailTemplate \Eccube\Entity\MailTemplate */ |
| 430 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_entry_confirm_mail_template_id']); |
| 431 |
|
|
| 432 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 433 |
|
'BaseInfo' => $this->BaseInfo, |
| 434 |
|
'Customer' => $Customer, |
| 435 |
|
'activateUrl' => $activateUrl, |
| 436 |
|
]); |
| 437 |
|
|
| 438 |
|
$message = (new \Swift_Message()) |
| 439 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 440 |
|
->setFrom([$this->BaseInfo->getEmail03() => $this->BaseInfo->getShopName()]) |
| 441 |
|
->setTo([$Customer->getEmail()]) |
| 442 |
|
->setBcc($this->BaseInfo->getEmail01()) |
| 443 |
|
->setReplyTo($this->BaseInfo->getEmail03()) |
| 444 |
|
->setReturnPath($this->BaseInfo->getEmail04()); |
| 445 |
|
|
| 446 |
|
// HTMLテンプレートが存在する場合 |
| 447 |
|
$htmlFileName = $this->getHtmlTemplate($MailTemplate->getFileName()); |
| 448 |
|
if (!is_null($htmlFileName)) { |
| 449 |
|
$htmlBody = $this->twig->render($htmlFileName, [ |
| 450 |
|
'BaseInfo' => $this->BaseInfo, |
| 451 |
|
'Customer' => $Customer, |
| 452 |
|
'activateUrl' => $activateUrl, |
| 453 |
|
]); |
| 454 |
|
|
| 455 |
|
$message |
| 456 |
|
->setContentType('text/plain; charset=UTF-8') |
| 457 |
|
->setBody($body, 'text/plain') |
| 458 |
|
->addPart($htmlBody, 'text/html'); |
| 459 |
|
} else { |
| 460 |
|
$message->setBody($body); |
| 461 |
|
} |
| 462 |
|
|
| 463 |
|
$event = new EventArgs( |
| 464 |
|
[ |
| 465 |
|
'message' => $message, |
| 466 |
|
'Customer' => $Customer, |
| 467 |
|
'BaseInfo' => $this->BaseInfo, |
| 468 |
|
'activateUrl' => $activateUrl, |
| 469 |
|
], |
| 470 |
|
null |
| 471 |
|
); |
| 472 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_ADMIN_CUSTOMER_CONFIRM, $event); |
| 473 |
|
|
| 474 |
|
$count = $this->mailer->send($message); |
| 475 |
|
|
| 476 |
|
log_info('仮会員登録再送メール送信完了', ['count' => $count]); |
| 477 |
|
|
| 478 |
|
return $count; |
| 479 |
|
} |
| 480 |
|
|
| 481 |
|
/** |
| 482 |
|
* Send admin order mail. |
|
@@ 591-644 (lines=54) @@
|
| 588 |
|
* @param $Customer 会員情報 |
| 589 |
|
* @param string $password |
| 590 |
|
*/ |
| 591 |
|
public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password) |
| 592 |
|
{ |
| 593 |
|
log_info('パスワード変更完了メール送信開始'); |
| 594 |
|
|
| 595 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_reset_complete_mail_template_id']); |
| 596 |
|
|
| 597 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 598 |
|
'BaseInfo' => $this->BaseInfo, |
| 599 |
|
'Customer' => $Customer, |
| 600 |
|
'password' => $password, |
| 601 |
|
]); |
| 602 |
|
|
| 603 |
|
$message = (new \Swift_Message()) |
| 604 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 605 |
|
->setFrom([$this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()]) |
| 606 |
|
->setTo([$Customer->getEmail()]) |
| 607 |
|
->setBcc($this->BaseInfo->getEmail01()) |
| 608 |
|
->setReplyTo($this->BaseInfo->getEmail03()) |
| 609 |
|
->setReturnPath($this->BaseInfo->getEmail04()); |
| 610 |
|
|
| 611 |
|
// HTMLテンプレートが存在する場合 |
| 612 |
|
$htmlFileName = $this->getHtmlTemplate($MailTemplate->getFileName()); |
| 613 |
|
if (!is_null($htmlFileName)) { |
| 614 |
|
$htmlBody = $this->twig->render($htmlFileName, [ |
| 615 |
|
'BaseInfo' => $this->BaseInfo, |
| 616 |
|
'Customer' => $Customer, |
| 617 |
|
'password' => $password, |
| 618 |
|
]); |
| 619 |
|
|
| 620 |
|
$message |
| 621 |
|
->setContentType('text/plain; charset=UTF-8') |
| 622 |
|
->setBody($body, 'text/plain') |
| 623 |
|
->addPart($htmlBody, 'text/html'); |
| 624 |
|
} else { |
| 625 |
|
$message->setBody($body); |
| 626 |
|
} |
| 627 |
|
|
| 628 |
|
$event = new EventArgs( |
| 629 |
|
[ |
| 630 |
|
'message' => $message, |
| 631 |
|
'Customer' => $Customer, |
| 632 |
|
'BaseInfo' => $this->BaseInfo, |
| 633 |
|
'password' => $password, |
| 634 |
|
], |
| 635 |
|
null |
| 636 |
|
); |
| 637 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_PASSWORD_RESET_COMPLETE, $event); |
| 638 |
|
|
| 639 |
|
$count = $this->mailer->send($message); |
| 640 |
|
|
| 641 |
|
log_info('パスワード変更完了メール送信完了', ['count' => $count]); |
| 642 |
|
|
| 643 |
|
return $count; |
| 644 |
|
} |
| 645 |
|
|
| 646 |
|
/** |
| 647 |
|
* 発送通知メールを送信する. |