You are here

public static function Utilities::send_demo_query in Drupal OAuth & OpenID Connect Login - OAuth2 Client SSO Login 7

2 calls to Utilities::send_demo_query()
miniorange_oauth_client_rfd_submit in ./miniorange_oauth_client_rfd.inc
send_rfd_query in ./miniorange_oauth_client_licensing.inc
Send support query.

File

includes/Utilities.php, line 204

Class

Utilities

Code

public static function send_demo_query($email, $query, $description) {
  if (empty($email) || empty($description)) {
    if (empty($email)) {
      drupal_set_message(t('The <b>Email Address</b> field is required.'), 'error');
    }
    if (empty($description)) {
      drupal_set_message(t('The <b>Description</b> field is required.'), 'error');
    }
    return;
  }
  if (!valid_email_address($email)) {
    drupal_set_message(t('The email address <b><u>' . $email . '</u></b> is not valid.'), 'error');
    return;
  }
  $phone = variable_get('miniorange_oauth_client_customer_admin_phone');
  $support = new MiniorangeOAuthClientSupport($email, $phone, $query, 'demo');
  $support_response = $support
    ->sendSupportQuery();
  if ($support_response) {
    drupal_set_message(t('Request demo query successfully sent. We will get back to you shortly!'), 'status');
  }
  else {
    drupal_set_message(t('Error sending request demo query'), 'error');
  }
}