@@ 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. |
|
@@ 411-465 (lines=55) @@ | ||
408 | * @param $Customer 会員情報 |
|
409 | * @param string $activateUrl アクティベート用url |
|
410 | */ |
|
411 | public function sendAdminCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl) |
|
412 | { |
|
413 | log_info('仮会員登録再送メール送信開始'); |
|
414 | ||
415 | /* @var $MailTemplate \Eccube\Entity\MailTemplate */ |
|
416 | $MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_entry_confirm_mail_template_id']); |
|
417 | ||
418 | $body = $this->twig->render($MailTemplate->getFileName(), [ |
|
419 | 'BaseInfo' => $this->BaseInfo, |
|
420 | 'Customer' => $Customer, |
|
421 | 'activateUrl' => $activateUrl, |
|
422 | ]); |
|
423 | ||
424 | $message = (new \Swift_Message()) |
|
425 | ->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
|
426 | ->setFrom([$this->BaseInfo->getEmail03() => $this->BaseInfo->getShopName()]) |
|
427 | ->setTo([$Customer->getEmail()]) |
|
428 | ->setBcc($this->BaseInfo->getEmail01()) |
|
429 | ->setReplyTo($this->BaseInfo->getEmail03()) |
|
430 | ->setReturnPath($this->BaseInfo->getEmail04()); |
|
431 | ||
432 | // HTMLテンプレートが存在する場合 |
|
433 | $htmlFileName = $this->getHtmlTemplate($MailTemplate->getFileName()); |
|
434 | if (!is_null($htmlFileName)) { |
|
435 | $htmlBody = $this->twig->render($htmlFileName, [ |
|
436 | 'BaseInfo' => $this->BaseInfo, |
|
437 | 'Customer' => $Customer, |
|
438 | 'activateUrl' => $activateUrl, |
|
439 | ]); |
|
440 | ||
441 | $message |
|
442 | ->setContentType('text/plain; charset=UTF-8') |
|
443 | ->setBody($body, 'text/plain') |
|
444 | ->addPart($htmlBody, 'text/html'); |
|
445 | } else { |
|
446 | $message->setBody($body); |
|
447 | } |
|
448 | ||
449 | $event = new EventArgs( |
|
450 | [ |
|
451 | 'message' => $message, |
|
452 | 'Customer' => $Customer, |
|
453 | 'BaseInfo' => $this->BaseInfo, |
|
454 | 'activateUrl' => $activateUrl, |
|
455 | ], |
|
456 | null |
|
457 | ); |
|
458 | $this->eventDispatcher->dispatch(EccubeEvents::MAIL_ADMIN_CUSTOMER_CONFIRM, $event); |
|
459 | ||
460 | $count = $this->mailer->send($message); |
|
461 | ||
462 | log_info('仮会員登録再送メール送信完了', ['count' => $count]); |
|
463 | ||
464 | return $count; |
|
465 | } |
|
466 | ||
467 | /** |
|
468 | * Send admin order mail. |
|
@@ 577-630 (lines=54) @@ | ||
574 | * @param $Customer 会員情報 |
|
575 | * @param string $password |
|
576 | */ |
|
577 | public function sendPasswordResetCompleteMail(\Eccube\Entity\Customer $Customer, $password) |
|
578 | { |
|
579 | log_info('パスワード変更完了メール送信開始'); |
|
580 | ||
581 | $MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_reset_complete_mail_template_id']); |
|
582 | ||
583 | $body = $this->twig->render($MailTemplate->getFileName(), [ |
|
584 | 'BaseInfo' => $this->BaseInfo, |
|
585 | 'Customer' => $Customer, |
|
586 | 'password' => $password, |
|
587 | ]); |
|
588 | ||
589 | $message = (new \Swift_Message()) |
|
590 | ->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
|
591 | ->setFrom([$this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()]) |
|
592 | ->setTo([$Customer->getEmail()]) |
|
593 | ->setBcc($this->BaseInfo->getEmail01()) |
|
594 | ->setReplyTo($this->BaseInfo->getEmail03()) |
|
595 | ->setReturnPath($this->BaseInfo->getEmail04()); |
|
596 | ||
597 | // HTMLテンプレートが存在する場合 |
|
598 | $htmlFileName = $this->getHtmlTemplate($MailTemplate->getFileName()); |
|
599 | if (!is_null($htmlFileName)) { |
|
600 | $htmlBody = $this->twig->render($htmlFileName, [ |
|
601 | 'BaseInfo' => $this->BaseInfo, |
|
602 | 'Customer' => $Customer, |
|
603 | 'password' => $password, |
|
604 | ]); |
|
605 | ||
606 | $message |
|
607 | ->setContentType('text/plain; charset=UTF-8') |
|
608 | ->setBody($body, 'text/plain') |
|
609 | ->addPart($htmlBody, 'text/html'); |
|
610 | } else { |
|
611 | $message->setBody($body); |
|
612 | } |
|
613 | ||
614 | $event = new EventArgs( |
|
615 | [ |
|
616 | 'message' => $message, |
|
617 | 'Customer' => $Customer, |
|
618 | 'BaseInfo' => $this->BaseInfo, |
|
619 | 'password' => $password, |
|
620 | ], |
|
621 | null |
|
622 | ); |
|
623 | $this->eventDispatcher->dispatch(EccubeEvents::MAIL_PASSWORD_RESET_COMPLETE, $event); |
|
624 | ||
625 | $count = $this->mailer->send($message); |
|
626 | ||
627 | log_info('パスワード変更完了メール送信完了', ['count' => $count]); |
|
628 | ||
629 | return $count; |
|
630 | } |
|
631 | ||
632 | /** |
|
633 | * ポイントでマイナス発生時にメール通知する。 |