|
@@ 149-186 (lines=38) @@
|
| 146 |
|
* |
| 147 |
|
* @param $Customer 会員情報 |
| 148 |
|
*/ |
| 149 |
|
public function sendCustomerCompleteMail(\Eccube\Entity\Customer $Customer) |
| 150 |
|
{ |
| 151 |
|
log_info('会員登録完了メール送信開始'); |
| 152 |
|
|
| 153 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_entry_complete_mail_template_id']); |
| 154 |
|
|
| 155 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 156 |
|
'header' => $MailTemplate->getMailHeader(), |
| 157 |
|
'footer' => $MailTemplate->getMailFooter(), |
| 158 |
|
'Customer' => $Customer, |
| 159 |
|
'BaseInfo' => $this->BaseInfo, |
| 160 |
|
]); |
| 161 |
|
|
| 162 |
|
$message = (new \Swift_Message()) |
| 163 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 164 |
|
->setFrom([$this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()]) |
| 165 |
|
->setTo([$Customer->getEmail()]) |
| 166 |
|
->setBcc($this->BaseInfo->getEmail01()) |
| 167 |
|
->setReplyTo($this->BaseInfo->getEmail03()) |
| 168 |
|
->setReturnPath($this->BaseInfo->getEmail04()) |
| 169 |
|
->setBody($body); |
| 170 |
|
|
| 171 |
|
$event = new EventArgs( |
| 172 |
|
[ |
| 173 |
|
'message' => $message, |
| 174 |
|
'Customer' => $Customer, |
| 175 |
|
'BaseInfo' => $this->BaseInfo, |
| 176 |
|
], |
| 177 |
|
null |
| 178 |
|
); |
| 179 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_CUSTOMER_COMPLETE, $event); |
| 180 |
|
|
| 181 |
|
$count = $this->mailer->send($message); |
| 182 |
|
|
| 183 |
|
log_info('会員登録完了メール送信完了', ['count' => $count]); |
| 184 |
|
|
| 185 |
|
return $count; |
| 186 |
|
} |
| 187 |
|
|
| 188 |
|
/** |
| 189 |
|
* Send withdraw mail. |
|
@@ 194-232 (lines=39) @@
|
| 191 |
|
* @param $Customer Customer |
| 192 |
|
* @param $email string |
| 193 |
|
*/ |
| 194 |
|
public function sendCustomerWithdrawMail(Customer $Customer, string $email) |
| 195 |
|
{ |
| 196 |
|
log_info('退会手続き完了メール送信開始'); |
| 197 |
|
|
| 198 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_customer_withdraw_mail_template_id']); |
| 199 |
|
|
| 200 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 201 |
|
'header' => $MailTemplate->getMailHeader(), |
| 202 |
|
'footer' => $MailTemplate->getMailFooter(), |
| 203 |
|
'Customer' => $Customer, |
| 204 |
|
'BaseInfo' => $this->BaseInfo, |
| 205 |
|
]); |
| 206 |
|
|
| 207 |
|
$message = (new \Swift_Message()) |
| 208 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 209 |
|
->setFrom([$this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()]) |
| 210 |
|
->setTo([$email]) |
| 211 |
|
->setBcc($this->BaseInfo->getEmail01()) |
| 212 |
|
->setReplyTo($this->BaseInfo->getEmail03()) |
| 213 |
|
->setReturnPath($this->BaseInfo->getEmail04()) |
| 214 |
|
->setBody($body); |
| 215 |
|
|
| 216 |
|
$event = new EventArgs( |
| 217 |
|
[ |
| 218 |
|
'message' => $message, |
| 219 |
|
'Customer' => $Customer, |
| 220 |
|
'BaseInfo' => $this->BaseInfo, |
| 221 |
|
'email' => $email, |
| 222 |
|
], |
| 223 |
|
null |
| 224 |
|
); |
| 225 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_CUSTOMER_WITHDRAW, $event); |
| 226 |
|
|
| 227 |
|
$count = $this->mailer->send($message); |
| 228 |
|
|
| 229 |
|
log_info('退会手続き完了メール送信完了', ['count' => $count]); |
| 230 |
|
|
| 231 |
|
return $count; |
| 232 |
|
} |
| 233 |
|
|
| 234 |
|
/** |
| 235 |
|
* Send contact mail. |
|
@@ 239-277 (lines=39) @@
|
| 236 |
|
* |
| 237 |
|
* @param $formData お問い合わせ内容 |
| 238 |
|
*/ |
| 239 |
|
public function sendContactMail($formData) |
| 240 |
|
{ |
| 241 |
|
log_info('お問い合わせ受付メール送信開始'); |
| 242 |
|
|
| 243 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_contact_mail_template_id']); |
| 244 |
|
|
| 245 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 246 |
|
'header' => $MailTemplate->getMailHeader(), |
| 247 |
|
'footer' => $MailTemplate->getMailFooter(), |
| 248 |
|
'data' => $formData, |
| 249 |
|
'BaseInfo' => $this->BaseInfo, |
| 250 |
|
]); |
| 251 |
|
|
| 252 |
|
// 問い合わせ者にメール送信 |
| 253 |
|
$message = (new \Swift_Message()) |
| 254 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 255 |
|
->setFrom([$this->BaseInfo->getEmail02() => $this->BaseInfo->getShopName()]) |
| 256 |
|
->setTo([$formData['email']]) |
| 257 |
|
->setBcc($this->BaseInfo->getEmail02()) |
| 258 |
|
->setReplyTo($this->BaseInfo->getEmail02()) |
| 259 |
|
->setReturnPath($this->BaseInfo->getEmail04()) |
| 260 |
|
->setBody($body); |
| 261 |
|
|
| 262 |
|
$event = new EventArgs( |
| 263 |
|
[ |
| 264 |
|
'message' => $message, |
| 265 |
|
'formData' => $formData, |
| 266 |
|
'BaseInfo' => $this->BaseInfo, |
| 267 |
|
], |
| 268 |
|
null |
| 269 |
|
); |
| 270 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_CONTACT, $event); |
| 271 |
|
|
| 272 |
|
$count = $this->mailer->send($message); |
| 273 |
|
|
| 274 |
|
log_info('お問い合わせ受付メール送信完了', ['count' => $count]); |
| 275 |
|
|
| 276 |
|
return $count; |
| 277 |
|
} |
| 278 |
|
|
| 279 |
|
/** |
| 280 |
|
* Alias of sendContactMail(). |
|
@@ 300-337 (lines=38) @@
|
| 297 |
|
* |
| 298 |
|
* @return \Swift_Message |
| 299 |
|
*/ |
| 300 |
|
public function sendOrderMail(\Eccube\Entity\Order $Order) |
| 301 |
|
{ |
| 302 |
|
log_info('受注メール送信開始'); |
| 303 |
|
|
| 304 |
|
$MailTemplate = $this->mailTemplateRepository->find($this->eccubeConfig['eccube_order_mail_template_id']); |
| 305 |
|
|
| 306 |
|
$body = $this->twig->render($MailTemplate->getFileName(), [ |
| 307 |
|
'header' => $MailTemplate->getMailHeader(), |
| 308 |
|
'footer' => $MailTemplate->getMailFooter(), |
| 309 |
|
'Order' => $Order, |
| 310 |
|
]); |
| 311 |
|
|
| 312 |
|
$message = (new \Swift_Message()) |
| 313 |
|
->setSubject('['.$this->BaseInfo->getShopName().'] '.$MailTemplate->getMailSubject()) |
| 314 |
|
->setFrom([$this->BaseInfo->getEmail01() => $this->BaseInfo->getShopName()]) |
| 315 |
|
->setTo([$Order->getEmail()]) |
| 316 |
|
->setBcc($this->BaseInfo->getEmail01()) |
| 317 |
|
->setReplyTo($this->BaseInfo->getEmail03()) |
| 318 |
|
->setReturnPath($this->BaseInfo->getEmail04()) |
| 319 |
|
->setBody($body); |
| 320 |
|
|
| 321 |
|
$event = new EventArgs( |
| 322 |
|
[ |
| 323 |
|
'message' => $message, |
| 324 |
|
'Order' => $Order, |
| 325 |
|
'MailTemplate' => $MailTemplate, |
| 326 |
|
'BaseInfo' => $this->BaseInfo, |
| 327 |
|
], |
| 328 |
|
null |
| 329 |
|
); |
| 330 |
|
$this->eventDispatcher->dispatch(EccubeEvents::MAIL_ORDER, $event); |
| 331 |
|
|
| 332 |
|
$count = $this->mailer->send($message); |
| 333 |
|
|
| 334 |
|
log_info('受注メール送信完了', ['count' => $count]); |
| 335 |
|
|
| 336 |
|
return $message; |
| 337 |
|
} |
| 338 |
|
|
| 339 |
|
/** |
| 340 |
|
* Send admin customer confirm mail. |