Inheritance: extends Symfony\Component\EventDispatcher\Event
 /**
  * On FormBuilderSubmittedEvent
  *
  * @param FormBuilderSubmittedEvent $event
  */
 public function onFormBuilderSubmittedEvent(FormBuilderSubmittedEvent $event)
 {
     if ($this->modulesSettings->get('Mailmotor', 'automatically_subscribe_from_form_builder_submitted_form', false)) {
         $form = $event->getForm();
         $data = $event->getData();
         $email = null;
         // Check if we have a replyTo email set
         foreach ($form['fields'] as $field) {
             if (array_key_exists('reply_to', $field['settings']) && $field['settings']['reply_to'] === true) {
                 $email = unserialize($data[$field['id']]['value']);
             }
         }
         // Define language
         $language = array_key_exists('language', $form) ? $form['language'] : $this->modulesSettings->get('Core', 'default_language', 'en');
         // We subscribe the replyTo email
         try {
             // Does email exists or not in our mailing list
             $exists = (bool) $this->subscriber->exists($email);
             // We only need to subscribe when not exists
             if (!$exists) {
                 $this->subscriber->subscribe($email, $language, array(), array(), false);
             }
         } catch (NotImplementedException $e) {
             // We do nothing as fallback when no mail-engine is chosen in the Backend
         }
     }
 }
 /**
  * @param FormBuilderSubmittedEvent $event
  */
 public function onFormSubmitted(FormBuilderSubmittedEvent $event)
 {
     $form = $event->getForm();
     // need to send mail
     if ($form['method'] == 'database_email') {
         // build our message
         $from = FrontendModel::get('fork.settings')->get('Core', 'mailer_from');
         $fieldData = $this->getEmailFields($event->getData());
         $message = \Common\Mailer\Message::newInstance(sprintf(FL::getMessage('FormBuilderSubject'), $form['name']))->parseHtml(FRONTEND_MODULES_PATH . '/FormBuilder/Layout/Templates/Mails/Form.tpl', array('sentOn' => time(), 'name' => $form['name'], 'fields' => $fieldData), true)->setTo($form['email'])->setFrom(array($from['email'] => $from['name']));
         // check if we have a replyTo email set
         foreach ($form['fields'] as $field) {
             if (array_key_exists('reply_to', $field['settings']) && $field['settings']['reply_to'] === true) {
                 $email = $fieldData[$field['id']]['value'];
                 $message->setReplyTo(array($email => $email));
             }
         }
         if ($message->getReplyTo() === null) {
             $replyTo = FrontendModel::get('fork.settings')->get('Core', 'mailer_reply_to');
             $message->setReplyTo(array($replyTo['email'] => $replyTo['name']));
         }
         $this->mailer->send($message);
     }
 }
 /**
  * @param FormBuilderSubmittedEvent $event
  */
 public function onFormSubmitted(FormBuilderSubmittedEvent $event)
 {
     $form = $event->getForm();
     FrontendFormBuilderModel::notifyAdmin(array('form_id' => $form['id'], 'entry_id' => $event->getDataId()));
 }