You are here

public function MiniorangeSupport::submitForm in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

src/Form/MiniorangeSupport.php, line 200
Contains support form for miniOrange 2FA Login Module.

Class

MiniorangeSupport
Showing Support form info.

Namespace

Drupal\miniorange_saml\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $form_values = $form_state
    ->getValues();
  $email = '';
  $phone = '';
  $query = '';
  $query_type = '';
  if ($form_values['mo_saml_vertical_tabs__active_tab'] === 'edit-miniorange-support') {
    $email = $form_values['mo_saml_support_email_address'];
    $phone = $form_values['mo_saml_support_phone_number'];
    $query = $form_values['mo_saml_support_query'];
    $query_type = 'Support';
  }
  elseif ($form_values['mo_saml_vertical_tabs__active_tab'] === 'edit-miniorange-demo-request') {
    $email = $form_values['mo_saml_demo_email_address'];
    $phone = $form_values['mo_saml_demo_plan'];
    $query = $form_values['mo_saml_demo_description'];
    $query_type = 'Demo Request';
  }
  elseif ($form_values['mo_saml_vertical_tabs__active_tab'] === 'edit-miniorange-feature-request') {
    $email = $form_values['mo_saml_feature_email_address'];
    $phone = $form_values['mo_saml_feature_phone_number'];
    $query = $form_values['mo_saml_feature_query'];
    $query_type = 'New Feature Request';
  }
  Utilities::send_support_query($email, $phone, $query, $query_type);
}