You are here

public function WebformEmailProvider::moduleEnabled in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformEmailProvider.php \Drupal\webform\WebformEmailProvider::moduleEnabled()

Determine if mail module is installed and enabled.

Parameters

string $module: Mail module name.

Return value

bool TRUE if mail module is installed and enabled.

Overrides WebformEmailProviderInterface::moduleEnabled

2 calls to WebformEmailProvider::moduleEnabled()
WebformEmailProvider::check in src/WebformEmailProvider.php
Check if the Webform module should provide support for sending HTML emails.
WebformEmailProvider::getModule in src/WebformEmailProvider.php
Get the HTML email provider module machine name.

File

src/WebformEmailProvider.php, line 151

Class

WebformEmailProvider
Manages and provides HTML email support.

Namespace

Drupal\webform

Code

public function moduleEnabled($module) {

  // Make sure module exists and is installed.
  if (!$this->moduleHandler
    ->moduleExists($module)) {
    return FALSE;
  }

  // Make sure SMTP module is enabled.
  if ($module === 'smtp' && !$this->configFactory
    ->get('smtp.settings')
    ->get('smtp_on')) {
    return FALSE;
  }
  return TRUE;
}