function library_mail_tokens in Library 7
Same name and namespace in other branches
- 5.2 library.actions.inc \library_mail_tokens()
- 6.2 library.actions.inc \library_mail_tokens()
- 6 library.actions.inc \library_mail_tokens()
Returns the tokens present in a library email.
@todo Language parameter not used, check if necessary.
Parameters
array $params: The items to display overdue status for (via item name and due date).
mixed $language: Language parameter
Return value
array List of mail tokens for the user's name, his or her items and the site title.
1 call to library_mail_tokens()
- library_mail in ./
library.actions.inc - Implements hook_mail().
File
- ./
library.actions.inc, line 288 - Hooks into core Drupal actions module
Code
function library_mail_tokens($params, $language) {
$items = '';
foreach ($params['items'] as $id => $values) {
$items .= $values['item_name'] . ' (Due ' . format_date($values['due_date'], 'short') . ') ';
}
$tokens = array(
'!patronname' => $params['patron']['patron_name'],
'!site' => variable_get('site_name', 'Drupal'),
'!items' => $items,
);
return $tokens;
}