You are here

public static function PostmarkHandler::validateKey in Postmark 8

Validates Postmark API key.

1 call to PostmarkHandler::validateKey()
PostmarkHandler::checkApiSettings in src/PostmarkHandler.php
Check if API settings are correct and not empty.

File

src/PostmarkHandler.php, line 183

Class

PostmarkHandler
Mail handler to send out an email message array to the Postmark API.

Namespace

Drupal\postmark

Code

public static function validateKey($key) {
  if (self::checkLibrary() === FALSE) {
    return FALSE;
  }
  try {
    $postmark = new PostmarkClient($key);
  } catch (Exception $e) {
    return FALSE;
  }
  return TRUE;
}