get($engine)->render($template, $params, config('view.config', [])); } /** * 验证码通知 - 邮件模板 * * @param string $sms_code 验证码 * @param array $params 模板参数 * @return string */ public function emailCode(string $sms_code, array $params = []) { return $this->view(config('view.engine'), 'emails.verify-code', [ 'service_name' => $params['service_name'] ?? "邮箱绑定", 'sms_code' => $sms_code, 'domain' => $params['web_url'] ?? config('domain.web_url') ]); } /** * 系统错误通知 - 邮件模板 * * @param Throwable $throwable * @return string */ public function errorNotice(Throwable $throwable) { return $this->view(config('view.engine'), 'emails.error-notice', [ 'throwable' => $throwable->getTraceAsString(), 'message' => $throwable->getMessage() ]); } }