You are here

class MiniorangeSamlSupport in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

@file This class represents support information for customer.

Hierarchy

Expanded class hierarchy of MiniorangeSamlSupport

File

src/MiniorangeSamlSupport.php, line 12
This class represents support information for customer.

Namespace

Drupal\miniorange_saml
View source
class MiniorangeSamlSupport {
  public $email;
  public $phone;
  public $query;
  public $query_type;

  /**
   * Constructor.
   */
  public function __construct($email, $phone, $query, $query_type) {
    $this->email = $email;
    $this->phone = $phone;
    $this->query = $query;
    $this->query_type = $query_type;
  }

  /**
   * Send support query.
   */
  public function sendSupportQuery() {
    $modules_info = \Drupal::service('extension.list.module')
      ->getExtensionInfo('miniorange_saml');
    $modules_version = $modules_info['version'];
    if ($this->query_type === 'Demo Request') {
      $this->query = 'Demo request for ' . $this->phone . ' .<br> ' . $this->query;
    }
    $this->query = '[Drupal-' . Utilities::mo_get_drupal_core_version() . ' SAML SP ' . $this->query_type . ' | ' . $modules_version . '] ' . $this->query;
    $fields = array(
      'company' => $_SERVER['SERVER_NAME'],
      'email' => $this->email,
      'phone' => $this->query_type != 'Demo Request' ? $this->phone : '',
      'ccEmail' => MiniorangeSAMLConstants::SUPPORT_EMAIL,
      'query' => $this->query,
    );
    $url = MiniorangeSAMLConstants::SUPPORT_QUERY;
    $api = new MoAuthApi();
    return $api
      ->makeCurlCall($url, $fields);
  }

}

Members