You are here

function invite_mail in Invite 6.2

Same name and namespace in other branches
  1. 7.2 invite.module \invite_mail()

Implementation of hook_mail().

File

./invite.module, line 1206
Allows your users to send and track invitations to join your site.

Code

function invite_mail($key, &$message, $params) {
  global $user;
  $invite = $params['invite'];

  // Override Reply-To address.
  if (!variable_get('invite_use_users_email_replyto', 0)) {
    $reply_to = variable_get('invite_manual_reply_to', '');
  }
  elseif ($user->uid) {
    $reply_to = $user->mail;
  }
  if ($reply_to) {
    $message['headers']['Reply-To'] = $reply_to;
  }
  $message['subject'] = $invite->data['subject'];
  $template = t(_invite_get_mail_template());
  $tokens = _invite_token_types($invite);
  $message['body'][] = token_replace_multiple($template, $tokens);
}