public function createTemplateUrls($plain, $html) { $record = new Postmaster_MessageTemplateRecord(); $record->plain = $plain; $record->html = $html; $record->save(); return array('text' => UrlHelper::getSiteUrl('postmaster/template/text/' . $record->id), 'html' => UrlHelper::getSiteUrl('postmaster/template/html/' . $record->id)); }
public function actionGetText() { $id = craft()->request->getSegment(4); $record = Postmaster_MessageTemplateRecord::model()->findById($id); craft()->path->setTemplatesPath(CRAFT_BASE_PATH . 'plugins/postmaster/templates'); $this->renderTemplate('_messageTemplate', array('template' => $record->plain)); }