/** * @param string $theme * @param string $template * @return \OCA\TemplateEditor\Http\MailTemplateResponse */ public function render($theme, $template) { try { $template = new MailTemplate($theme, $template); return $template->getResponse(); } catch (\Exception $ex) { return new JSONResponse(array('message' => $ex->getMessage()), $ex->getCode()); } }