You are here

public function EmailWebformHandler::hasRecipient in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Plugin/WebformHandler/EmailWebformHandler.php \Drupal\webform\Plugin\WebformHandler\EmailWebformHandler::hasRecipient()

Confirm that a message has a recipient.

Parameters

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

array $message: An array of message parameters.

Return value

bool TRUE if the message has a recipient.

Overrides WebformHandlerMessageInterface::hasRecipient

2 calls to EmailWebformHandler::hasRecipient()
EmailWebformHandler::sendMessage in src/Plugin/WebformHandler/EmailWebformHandler.php
Sends and logs a webform submission message.
ScheduleEmailWebformHandler::scheduleMessage in modules/webform_scheduled_email/src/Plugin/WebformHandler/ScheduleEmailWebformHandler.php
Schedule the sending of an email.

File

src/Plugin/WebformHandler/EmailWebformHandler.php, line 1253

Class

EmailWebformHandler
Emails a webform submission.

Namespace

Drupal\webform\Plugin\WebformHandler

Code

public function hasRecipient(WebformSubmissionInterface $webform_submission, array $message) {

  // Don't send the message if To, CC, and BCC is empty.
  if (empty($message['to_mail']) && empty($message['cc_mail']) && empty($message['bcc_mail'])) {
    return FALSE;
  }
  else {
    return TRUE;
  }
}