Commit 1d9b81af authored by Dries's avatar Dries
Browse files

- Patch #830304 by solotandem: drupal_mail() doc example using D6 syntax for t().

parent 2a3bf449
...@@ -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;
* } * }
* } * }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment