Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
1d9b81af
Commit
1d9b81af
authored
Jul 28, 2010
by
Dries
Browse files
- Patch
#830304
by solotandem: drupal_mail() doc example using D6 syntax for t().
parent
2a3bf449
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/mail.inc
View file @
1d9b81af
...
@@ -53,12 +53,14 @@
...
@@ -53,12 +53,14 @@
* }
* }
*
*
* function example_mail($key, &$message, $params) {
* function example_mail($key, &$message, $params) {
* $language = $message['language'];
* $data['user'] = $params['account'];
* $variables = user_mail_tokens($params['account'], $language);
* $options['language'] = $message['language'];
* user_mail_tokens($variables, $data, $options);
* switch($key) {
* switch($key) {
* case 'notice':
* case 'notice':
* $message['subject'] = t('Notification from !site', $variables, $language->language);
* $langcode = $message['language']->language;
* $message['body'][] = t("Dear !username\n\nThere is new content available on the site.", $variables, $language->language);
* $message['subject'] = t('Notification from !site', $variables, array('langcode' => $langcode));
* $message['body'][] = t("Dear !username\n\nThere is new content available on the site.", $variables, array('langcode' => $langcode));
* break;
* break;
* }
* }
* }
* }
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment