elseif(\is_callable($this->messageTemplate)){ $message = ($this->messageTemplate)($content, $records); if(!$message instanceof Email){ thrownew \InvalidArgumentException(sprintf('Could not resolve message from a callable. Instance of "%s" is expected.', Email::class)); } }else{ thrownew \InvalidArgumentException('Could not resolve message as instance of Email or a callable returning it.'); }