function search_api_saved_searches_mail in Search API Saved Searches 8
Same name and namespace in other branches
- 7 search_api_saved_searches.module \search_api_saved_searches_mail()
Implements hook_mail().
Implemented on behalf of the "E-mail" notification plugin.
See also
\Drupal\search_api_saved_searches\Plugin\search_api_saved_searches\notification\Email
File
- ./
search_api_saved_searches.module, line 314 - Allows visitors to bookmark searches and get notifications for new results.
Code
function search_api_saved_searches_mail($key, &$message, $params) {
if (empty($params['plugin'])) {
return;
}
$plugin = $params['plugin'];
if (!$plugin instanceof Email) {
return;
}
switch ($key) {
case Email::MAIL_ACTIVATE:
$plugin
->getActivationMail($message, $params);
break;
case Email::MAIL_NEW_RESULTS:
$plugin
->getNewResultsMail($message, $params);
break;
}
}