public function update($tID) { $json = Loader::helper('json'); $tJSON = $json->decode(file_get_contents("php://input")); $t = \Concrete\Package\Formify\Src\FormifyTemplate::get($tID); foreach ($tJSON as $property => $value) { $t->set($property, $value); } }
public function edit() { $forms = \Concrete\Package\Formify\Src\FormifyForm::getAll(); $this->set('forms', $forms); foreach ($forms as $form) { if ($form->fID == $this->fID) { $f = $form; $this->set('f', $f); } } $templates = \Concrete\Package\Formify\Src\FormifyTemplate::all(); $this->set('templates', $templates); }
public function send($record) { $this->record = $record; $to = $this->getDestination(); $from = $this->from; $fromName = $this->fromName; $subject = $this->subject; $t = \Concrete\Package\Formify\Src\FormifyTemplate::get($this->tID); $html = $t->render($record, true); if ($to != '' && $subject != '') { if ($this->verifyCondition()) { $mh = Loader::helper('mail'); $mh->to($to); $mh->from($from, $fromName); $mh->setSubject($subject); $mh->setBodyHTML($html); @$mh->sendMail(); } } }