protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     $link = $this->getData()->getAbsoluteUrl() . '?key=' . $row->key;
     $mail = new Kwf_Mail_Template($this->getData());
     $mail->addTo($row->email);
     $mail->subject = $this->_getPlaceholder('subject');
     $mail->link = $link;
     $mail->send();
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     $link = $this->getData()->url . '?key=' . $row->key;
     $mail = new Kwf_Mail_Template($this->getData());
     $mail->addTo($row->email);
     $mail->subject = $this->_getPlaceholder('subject');
     $mail->link = 'http://' . Kwf_Registry::get('config')->server->domain . $link;
     $mail->send();
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     if (isset($_SERVER['HTTP_HOST'])) {
         $host = $_SERVER['HTTP_HOST'];
     } else {
         $host = Kwf_Registry::get('config')->server->domain;
     }
     if (substr($host, 0, 4) == 'www.') {
         $host = substr($host, 4);
     }
     $fromMailAddress = $this->_getSetting('fromMailAdress');
     if ($fromMailAddress) {
         $row->setFrom($fromMailAddress);
     } else {
         $row->setFrom("noreply@{$host}");
     }
     $settings = $this->getData()->parent->getComponent()->getMailSettings();
     $row->addTo($settings['recipient']);
     if ($settings['recipient_cc']) {
         $row->addCc($settings['recipient_cc']);
     }
     $row->setSubject(str_replace('%number%', $row->id, $settings['subject']));
     $row->setCheckSpam($settings['check_spam']);
     $msg = '';
     $formFieldComponents = self::_findFormFields($this->getData()->parent->getChildComponent('-paragraphs'));
     foreach ($formFieldComponents as $c) {
         $message = $c->getComponent()->getSubmitMessage($row);
         if ($message) {
             $msg .= $message . "\n";
         }
     }
     $row->sent_mail_content_text = $msg;
     $this->_beforeSendMail($row);
     $row->sendMail();
     //manuell aufrufen weils beim speichern nicht automatisch gemacht wird (da da der content nocht nicht vorhanden ist)
     if ($settings['send_confirm_mail']) {
         $c = Kwf_Component_Data_Root::getInstance()->getComponentById($settings['confirm_field_component_id']);
         if ($c && ($recipient = $row->{$c->getComponent()->getFormField()->getName()})) {
             $mail = new Kwf_Mail();
             $body = $this->getData()->trlKwf('Thank you for your inquiry, it will be processed as soon as posible.');
             $body .= "\n\n";
             $body .= $msg;
             $mail->setSubject(str_replace('%number%', $row->id, $settings['confirm_subject']));
             $mail->setBodyText($body);
             $hostNonWww = preg_replace('#^www\\.#', '', $this->getData()->getDomain());
             $fromAddress = str_replace('%host%', $hostNonWww, $this->getData()->getBaseProperty('email.from.address'));
             $fromName = str_replace('%host%', $hostNonWww, $this->getData()->getBaseProperty('email.from.name'));
             $mail->setFrom($fromAddress, $fromName);
             $mail->addTo($recipient);
             $mail->send();
         }
     }
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     $pageName = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($row->component_id)->getParentPage()->name;
     $recipient = $this->_getRecipient();
     $user = $row->getParentRow('User');
     if ($recipient['email']) {
         $tpl = new Kwf_Mail_Template($this);
         $tpl->data = $this->getData();
         $tpl->text = $row->text;
         $tpl->pageName = $pageName;
         $tpl->user = $user;
         $tpl->addTo($recipient['email'], $recipient['name']);
         $tpl->setFrom($user->email, "{$user->firstname} {$user->lastname}");
         $tpl->setSubject($this->getData()->trlKwf('Feedback to page ') . $pageName);
         $tpl->send();
     }
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     //if getCartOrderId was null (tough it should not happen as the cart is empty in that case and the form doesn't validate then)
     Kwc_Shop_Cart_Orders::setCartOrderId($row->id);
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     Kwc_Shop_Cart_Orders::setCartOrderId($row->id);
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     if (isset($_SERVER['HTTP_HOST'])) {
         $host = $_SERVER['HTTP_HOST'];
     } else {
         $host = Kwf_Registry::get('config')->server->domain;
     }
     $nlData = $this->getSubscribeToNewsletterComponent();
     $editComponentId = $nlData->getChildComponent('_editSubscriber')->componentId;
     $unsubscribeComponentId = null;
     $doubleOptInComponentId = null;
     if ($this->_getSetting('subscribeType') == self::DOUBLE_OPT_IN) {
         $doubleOptInComponentId = $this->getData()->getChildComponent('-doubleOptIn')->componentId;
     } else {
         $unsubscribeComponentId = $nlData->getChildComponent('_unsubscribe')->componentId;
     }
     $mail = $this->getData()->getChildComponent('-mail')->getComponent();
     $mail->send($row, array('formRow' => $row, 'host' => $host, 'unsubscribeComponentId' => $unsubscribeComponentId, 'editComponentId' => $editComponentId, 'doubleOptInComponentId' => $doubleOptInComponentId));
 }
 protected function _afterInsert(Kwf_Model_Row_Interface $row)
 {
     parent::_afterInsert($row);
     $params = array('gender' => $row->gender, 'title' => $row->title, 'firstname' => $row->firstname, 'lastname' => $row->lastname, 'email' => $row->email, 'format' => $row->format);
     $this->insertSubscription($params);
 }