modules/system/system.api.php, 489行
修改Drupal发送的邮件的任何方面.你可以用这个钩子为所有的外发邮件添加一个共同的页脚; 以任何方式添加额外的头部信息并且可以修改邮件发送. HTML格式离开邮件成为一种可能, 同时参考 drupal_mail().
$message A structured array containing the message to be altered. Keys in this array include: mail_id An id to identify the mail sent. Look into the module source codes for possible mail_id values. to The mail address or addresses where the message will be send to. The formatting of this string must comply with RFC 2822. subject Subject of the e-mail to be sent. This must not contain any newline characters, or the mail may not be sent properly. body An array of lines containing the message to be sent. Drupal will format the correct line endings for you. from The From, Reply-To, Return-Path and Error-To headers in $headers are already set to this value (if given). headers Associative array containing the headers to add. This is typically used to add extra headers (From, Cc, and Bcc).
None.
<?php function hook_mail_alter(&$message) { if ($message['mail_id'] == 'my_message') { $message['body'] .= "\n\n--\nMail sent out from " . variable_get('sitename', t('Drupal')); } } ?>
1 周 6 天之前
3 周 4 天之前
3 周 4 天之前
3 周 4 天之前
5 周 3 天之前
5 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 3 天之前