protected function EmailWebformHandler::getElementKeyFromToken in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Plugin/WebformHandler/EmailWebformHandler.php \Drupal\webform\Plugin\WebformHandler\EmailWebformHandler::getElementKeyFromToken()
Get element key from webform token.
Parameters
string $token: The token.
string $format: The element format.
Return value
string|null The element key or NULL if token can not be parsed.
2 calls to EmailWebformHandler::getElementKeyFromToken()
- EmailWebformHandler::buildElement in src/
Plugin/ WebformHandler/ EmailWebformHandler.php - Build A select other element for email address and names.
- EmailWebformHandler::getMessageEmails in src/
Plugin/ WebformHandler/ EmailWebformHandler.php - Get message to, cc, bcc, and from email addresses.
File
- src/
Plugin/ WebformHandler/ EmailWebformHandler.php, line 1686
Class
- EmailWebformHandler
- Emails a webform submission.
Namespace
Drupal\webform\Plugin\WebformHandlerCode
protected function getElementKeyFromToken($token, $format = 'raw') {
if (preg_match('/^\\[webform_submission:values:([^:]+):' . $format . '\\]$/', $token, $match)) {
return $match[1];
}
else {
return NULL;
}
}