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');
        }
    }
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');
        }
    }
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' ) ; } }
Add the content to a given message.

@param \Viserio\Component\Contract\Mail\Message $message
@param null|string                              $view
@param null|string                              $plain
@param null|string                              $raw
@param array                                    $data
Add the content to a given message .