Mercurial > defr > drupal > core
comparison includes/mail.inc @ 11:589fb7c02327 6.5
Drupal 6.5
| author | Franck Deroche <webmaster@defr.org> |
|---|---|
| date | Tue, 23 Dec 2008 14:32:19 +0100 |
| parents | fff6d4c8c043 |
| children |
comparison
equal
deleted
inserted
replaced
| 10:6f15c9d74937 | 11:589fb7c02327 |
|---|---|
| 1 <?php | 1 <?php |
| 2 // $Id: mail.inc,v 1.8.2.3 2008/05/19 08:19:00 goba Exp $ | 2 // $Id: mail.inc,v 1.8.2.4 2008/10/06 11:04:08 dries Exp $ |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * Compose and optionally send an e-mail message. | 5 * Compose and optionally send an e-mail message. |
| 6 * | 6 * |
| 7 * Sending an e-mail works with defining an e-mail template (subject, text | 7 * Sending an e-mail works with defining an e-mail template (subject, text |
| 33 * @code | 33 * @code |
| 34 * function example_notify($accounts) { | 34 * function example_notify($accounts) { |
| 35 * foreach ($accounts as $account) { | 35 * foreach ($accounts as $account) { |
| 36 * $params['account'] = $account; | 36 * $params['account'] = $account; |
| 37 * // example_mail() will be called based on the first drupal_mail() parameter. | 37 * // example_mail() will be called based on the first drupal_mail() parameter. |
| 38 * drupal_mail('example', 'notify', $account->mail, user_preferred_language($account), $params); | 38 * drupal_mail('example', 'notice', $account->mail, user_preferred_language($account), $params); |
| 39 * } | 39 * } |
| 40 * } | 40 * } |
| 41 * | 41 * |
| 42 * function example_mail($key, &$message, $params) { | 42 * function example_mail($key, &$message, $params) { |
| 43 * $language = $message['language']; | 43 * $language = $message['language']; |
| 433 * Keeps track of URLs and replaces them with placeholder tokens. | 433 * Keeps track of URLs and replaces them with placeholder tokens. |
| 434 */ | 434 */ |
| 435 function _drupal_html_to_mail_urls($match = NULL, $reset = FALSE) { | 435 function _drupal_html_to_mail_urls($match = NULL, $reset = FALSE) { |
| 436 global $base_url, $base_path; | 436 global $base_url, $base_path; |
| 437 static $urls = array(), $regexp; | 437 static $urls = array(), $regexp; |
| 438 | 438 |
| 439 if ($reset) { | 439 if ($reset) { |
| 440 // Reset internal URL list. | 440 // Reset internal URL list. |
| 441 $urls = array(); | 441 $urls = array(); |
| 442 } | 442 } |
| 443 else { | 443 else { |
