You are here

public function MailgunHandler::validateMailgunLibrary in Mailgun 8

Checks if Mailgun PHP SDK is installed correctly.

Parameters

bool $showMessage: Whether error messages should be shown.

Return value

bool Whether the Mailgun PHP SDK is installed correctly.

Overrides MailgunHandlerInterface::validateMailgunLibrary

2 calls to MailgunHandler::validateMailgunLibrary()
MailgunHandler::moduleStatus in src/MailgunHandler.php
Validates Mailgun library and API settings.
MailgunHandler::validateMailgunApiKey in src/MailgunHandler.php
Validates Mailgun API key.

File

src/MailgunHandler.php, line 234

Class

MailgunHandler
Mail handler to send out an email message array to the Mailgun API.

Namespace

Drupal\mailgun

Code

public function validateMailgunLibrary($showMessage = FALSE) {
  $libraryStatus = class_exists('\\Mailgun\\Mailgun');
  if ($showMessage === FALSE) {
    return $libraryStatus;
  }
  if ($libraryStatus === FALSE) {
    $this->messenger
      ->addMessage('The Mailgun library has not been installed correctly.', 'warning');
  }
  return $libraryStatus;
}