public function EmailWebformHandler::hasRecipient in Webform 6.x
Same name and namespace in other branches
- 8.5 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 1237
Class
- EmailWebformHandler
- Emails a webform submission.
Namespace
Drupal\webform\Plugin\WebformHandlerCode
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;
}
}