public function view(Application $app, Request $request)
{
if ($request->isXmlHttpRequest()) {
$id = $request->get('id');
$MailHistory = $app['eccube.repository.mail_history']->find($id);
if (is_null($MailHistory)) {
throw new NotFoundHttpException('history not found.');
}
$event = new EventArgs(array('MailHistory' => $MailHistory), $request);
$app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_ORDER_MAIL_VIEW_COMPLETE, $event);
return $app->render('Order/mail_view.twig', array('subject' => $MailHistory->getSubject(), 'body' => $MailHistory->getMailBody()));
}
}