Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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();
         }
     }
 }