protected function addContent(
        MessageContract $message,
        ?string $view,
        ?string $plain,
        ?string $raw,
        array $data
    ): void {
        if ($view !== null) {
            $message->setBody($this->createView($view, $data), 'text/html');
        }

        if ($plain !== null) {
            $method = $view !== null ? 'addPart' : 'setBody';

            $message->{$method}($this->createView($plain, $data), 'text/plain');
        }

        if ($raw !== null) {
            $method = ($view !== null || $plain !== null) ? 'addPart' : 'setBody';

            $message->{$method}($raw, 'text/plain');
        }
    }