Add the content to a given message.

@param  \Caravel\Mail\Message  $message
@param  string  $view
@param  string  $plain
@param  array   $data
@return void
555015
protected static function addContent($message, $view, $plain, $data)
    {
        if (isset($view)) {
            $message->setBody(self::getView($view, $data), 'text/html');
        }

        if (isset($plain)) {
            $message->addPart(self::getView($plain, $data), 'text/plain');
        }
    }
926330
public static function render($view, array $data = array())
    {
        if (self::$force || App::state() > 2) {
            \UtilsSandboxLoader('application/View/' . strtr($view, '.', '/') . '.php', self::$shared + $data);

            return $data = null;
        }

        return array_push(self::$views, array(strtr($view, '.', '/'), $data)) - 1;
    }
486423
public function create($view = null, array $data = [])
    {
        if (is_null($view)) {
            return $this;
        }

        return $this->render($view, $data, true)->content();
    }
1120825
public function renderBody($view, $layout = '//layouts/main', array $data = array())
    {
        $controller = new CController('SwiftMailerComponent');

        $viewPath = Yii::app()->getBasePath() . DIRECTORY_SEPARATOR . 'views';

        $viewFile   = $controller->resolveViewFile($view, $viewPath, $viewPath);
        $layoutFile = $controller->resolveViewFile($layout, $viewPath, $viewPath);

        $body = $controller->renderInternal($viewFile, $data, true);
        if (null !== $layout) {
            $body = $controller->renderInternal($layoutFile, array('content' => $body), true);
        }

        return $body;
    }
1171888
public function loadView($view, $data = array(), $mergeData = array())
    {
	$view = View::make($view, $data, $mergeData);

	return $this->loadHTML($view);
    }
999111
public function loadView($view, $data = array(), $mergeData = array())
    {
        $this->view = View::make($view, $data, $mergeData);
        return parent::loadView($view, $data, $mergeData);
    }
203602
protected function doSend($messageID = null, $plain = false) {

		$this->extend('onBeforeDoSend', $this);

		if(!$this->Subject() && $this->getUserTemplate()) {
			$this->setSubject($this->getUserTemplate()->Subject);
		}

		$from = $this->From();
		$config = Config::inst()->forClass('Email');

		if(!$from) {
			if($this->getUserTemplate()) {
				$from = $this->getUserTemplate()->From;
			}
			if(!$from) {
				$from = $config->send_all_emails_from ?: $config->admin_email;
			}

			$this->setFrom($from);
		}


		// Check if a list of Member objects has been given
		if($this->members) {
			foreach($this->members as $m) {
				$this->setTo($m->Email);
				$this->populateTemplate(array(
					'RecipientMember' => $m
				));
			}
		}

		if($this->config()->test_mode) {
			$this->parseVariables($plain);
		}
		else {
			if($plain) {
				parent::sendPlain($messageID);
			}
			else {
				parent::send($messageID);
			}
		}

		$this->extend('onAfterDoSend', $this);

		$this->persist();
	}
1204970
public function plain($view, array $data, $callback=null)
    {
        return $this->send(['text'=>$view], $data, $callback);
    }
1172417
public static function render($view, $data = array()){

        if( is_array($view) ){

            foreach( $view as $item ){
                self::render($item, $data);
            }

            return;
        }

        echo self::get($view, $data);
    }
271504
public function render($view, array $data = array())
    {
        $original_view = $this->view;

        if (!empty($data)) {
            $this->shared_data->merge($data);
        }

        $this->view = $view;

        if (null === $this->layout) {
            $this->yieldView();
        } else {
            require $this->layout;
        }

        if (false !== $this->response->chunked) {
            $this->response->chunk();
        }

        // restore state for parent render()
        $this->view = $original_view;
    }
413013
public function modify(string $content, string $plainText = null)
    {
        $this->html = $content;
        $this->text = $plainText;
    }
177561
public static function text($message, $data = null)
    {
        if (!static::$on) {
            return;
        }

        echo "--------------------------------------------------------------------------------\n";
        static::indent();
        echo static::getTime() . " - " . $message . "\n";
        if (is_array($data)) {
            print_r($data);
        } elseif ($data) {
            static::indent();
            echo "    " . $data . "\n";
        }
    }
877271
public function plain(string $view, array $data, $callback): Receipt
    {
        return $this->send(['text' => $view], $data, $callback);
    }
287155
public function output($view, array $data = null)
	{
		$response = new Response($this->render($view, $data), Response::HTTP_OK, ['Content-Type' => 'text/html']);
		$response->send();
	}
16748
public static function addView(string $view, array $data): void
    {
        if (self::$debugbar instanceof StandardDebugBar) {
            $collector = self::$debugbar->getCollector('views');

            if ($collector instanceof ViewCollector) {
                $collector->addView($view, $data);
            }
        }
    }
722474
public function sendEmail($subject, $view, $vars = [])
    {
        $vars['email'] = $email = $this->email;
        $vars['username'] = $username = $this->username;

        Mail::queue(['text' => $view], $vars, function ($message) use ($email, $username, $subject) {
            $message->subject($subject)->to($email, $username);

            if (config()->has('mail.reply_to')) {
                $message->replyTo(
                    config('mail.reply_to.email'),
                    config('mail.reply_to.name')
                );
            }
        });
    }
588584
public function render($view, array $data = [])
    {
        // Get Body-Template
        $template = $this->getTemplate($view);

        // extend with default data
        $data += $this->data;

        // set tags
        foreach ($data as $name => $value) {
            $template->tag($name, $value);
        }

        // Render Page
        return $this->applyFunctions(get_maintemplate((string)$template));
    }