You are here

function signup_mail in Signup 7

Same name and namespace in other branches
  1. 6.2 signup.module \signup_mail()
  2. 6 signup.module \signup_mail()

Implements hook_mail().

Constructs all of the email messages generated by the signup module.

Parameters

string $key: Unique key to indicate what message to build.

array $message: Reference to the message array being built.

array $params: Array of parameters to indicate what text to include in the message body. If $params['ignore_tokens'] is TRUE, none of the signup-provided tokens in the message body will be replaced, otherwise, tokens are replaced using the node passed in as $params['node'] and the signup data from $params['signup'].

See also

drupal_mail()

_signup_cron_send_reminders()

signup_sign_up_user()

signup_broadcast_form_submit()

File

./signup.module, line 1651
The Signup module (http://drupal.org/project/signup) manages replies to nodes. In particular, it's good for event management. Signup supports sending reminder emails and automatically closing signups for nodes with a start time, via the Event…

Code

function signup_mail($key, &$message, $params) {
  if (empty($params['ignore_tokens'])) {
    $tokens = _signup_get_email_tokens($params['node'], $params['signup']);
    $body = strtr($params['body'], $tokens);
    $subject = strtr($params['subject'], $tokens);
  }
  else {
    $body = $params['body'];
    $subject = $params['subject'];
  }
  $message['subject'] .= str_replace(array(
    "\r",
    "\n",
  ), '', $subject);
  $message['body'][] = $body;
}