{"record":{"id":"c161d9efa78e8bd6","repo":"krayin/laravel-crm","slug":"invalid-type-specified-for-getmessagebody-type","errorCode":null,"errorMessage":"Invalid type specified for getMessageBody(). \"type\" can either be text or html.","messagePattern":"Invalid type specified for getMessageBody\\(\\)\\. \"type\" can either be text or html\\.","errorType":"exception","errorClass":"\\Exception","httpStatus":null,"severity":"error","filePath":"packages/Webkul/Email/src/Helpers/Parser.php","lineNumber":462,"sourceCode":"                    } else {\n                        $htmlBody .= $this->decodeContentTransfer($this->getPartBody($part), $encodingType);\n                        $htmlBody = $this->charset->decodeCharset($htmlBody, $this->getPartCharset($part));\n                    }\n                }\n            }\n\n            $body = $htmlBody ?: $textBody;\n\n            if (is_array($this->files)) {\n                foreach ($this->files as $file) {\n                    if ($file['contentId']) {\n                        $body = str_replace('cid:'.preg_replace('/[<>]/', '', $file['contentId']), $file['path'], $body);\n                        $path = $file['path'];\n                    }\n                }\n            }\n        } else {\n            throw new \\Exception('Invalid type specified for getMessageBody(). \"type\" can either be text or html.');\n        }\n\n        return $body;\n    }\n\n    /**\n     * Get text message body.\n     *\n     * @return string\n     */\n    public function getTextMessageBody()\n    {\n        $textBody = null;\n\n        foreach ($this->parts as $key => $part) {\n            if ($this->getPart('content-disposition', $part) != 'attachment') {\n                $headers = $this->getPart('headers', $part);\n                $encodingType = array_key_exists('content-transfer-encoding', $headers) ? $headers['content-transfer-encoding'] : '';","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/krayin/laravel-crm/blob/13d6988cda8d69ece45ee1890effc90a7f21cdc1/packages/Webkul/Email/src/Helpers/Parser.php#L444-L480","documentation":"Error \"Invalid type specified for getMessageBody(). \"type\" can either be text or html.\" thrown in krayin/laravel-crm.","triggerScenarios":"Thrown at packages/Webkul/Email/src/Helpers/Parser.php:462 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13d6988cda8d69ece45ee1890effc90a7f21cdc1","analyzedAt":"2026-08-17T00:58:29.000Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}