これで大丈夫でしょうか?
顧客宛てに1通、管理者宛てに2通届く時のソースです。
public function sendAdminCustomerConfirmMail(\Eccube\Entity\Customer $Customer, $activateUrl)
{
log_info('仮会員登録再送メール送信開始');
$body = $this->app->renderView('Mail/entry_confirm.twig', array(
'Customer' => $Customer,
'BaseInfo' => $this->BaseInfo,
'activateUrl' => $activateUrl,
));
$message = \Swift_Message::newInstance()
->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認')
->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
->setTo(array($Customer->getEmail()))
->setReplyTo($this->BaseInfo->getEmail03())
->setReturnPath($this->BaseInfo->getEmail04())
->setBody($body);
$event = new EventArgs(
array(
'message' => $message,
'Customer' => $Customer,
'BaseInfo' => $this->BaseInfo,
'activateUrl' => $activateUrl,
),
null
);
$this->app['eccube.event.dispatcher']->dispatch(EccubeEvents::MAIL_CUSTOMER_CONFIRM, $event);
$count = $this->app->mail($message, $failures);
//管理者向けのメール送信をここに追記↓
$message = \Swift_Message::newInstance()
->setSubject('[' . $this->BaseInfo->getShopName() . '] 会員登録のご確認')
->setFrom(array($this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()))
->setTo(array($this->BaseInfo->getEmail01()))
->setReplyTo($this->BaseInfo->getEmail03())
->setReturnPath($this->BaseInfo->getEmail04())
->setBody($body);
$countDummy = $this->app->mail($message, $failures);
//ここまで↑
log_info('仮会員登録メール送信完了', array('count' => $count));
return $count;
}