Craft\FormBuilder2_TemplateController::actionGetEmailTemplate PHP Method

actionGetEmailTemplate() public method

    public function actionGetEmailTemplate()
    {
        $id = craft()->request->getPost('templateId');
        // $emailTemplate = craft()->formBuilder2
        $variables['id'] = $id;
        $variables['foo'] = 'bar';
        craft()->templates->setTemplatesPath(craft()->path->getPluginsPath());
        $html = craft()->templates->render('formbuilder2/templates/email/layouts/template-' . $id, $variables);
        craft()->templates->setTemplatesPath(craft()->templates->getTemplatesPath());
        $this->returnJson($html);
    }