{"record":{"id":"feb7cb46f818c3b8","repo":"getgrav/grav","slug":"the-email-can-be-only-string-or-array","errorCode":null,"errorMessage":"The email can be only string or array","messagePattern":"The email can be only string or array","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Scheduler/Job.php","lineNumber":652,"sourceCode":"     * @return mixed\n     */\n    public function getOutput()\n    {\n        return $this->output;\n    }\n\n    /**\n     * Set the emails where the output should be sent to.\n     * The Job should be set to write output to a file\n     * for this to work.\n     *\n     * @param  string|array $email\n     * @return self\n     */\n    public function email($email)\n    {\n        if (!is_string($email) && !is_array($email)) {\n            throw new InvalidArgumentException('The email can be only string or array');\n        }\n\n        $this->emailTo = is_array($email) ? $email : [$email];\n        // Force the job to run in foreground\n        $this->inForeground();\n\n        return $this;\n    }\n\n    /**\n     * Email the output of the job, if any.\n     *\n     * @return bool\n     */\n    private function emailOutput()\n    {\n        if (!count($this->outputTo) || !count($this->emailTo)) {\n            return false;","sourceCodeStart":634,"sourceCodeEnd":670,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Scheduler/Job.php#L634-L670","documentation":"Error \"The email can be only string or array\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Scheduler/Job.php:652 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":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}