You are here

function invite_by_email_mail in Invite 7.4

Implements hook_mail().

File

modules/invite_by_email/invite_by_email.module, line 285
Main file for Invite by e-mail.

Code

function invite_by_email_mail($key, &$message, $params) {
  $invite = invite_load($params['invite']);
  if (!empty($params['reply-to'])) {
    $message['headers']['Reply-To'] = $params['reply-to'];
  }
  $subject = $invite->field_invitation_email_subject[LANGUAGE_NONE][0]['safe_value'];
  $message['subject'] = str_replace(array(
    "\r",
    "\n",
  ), '', trim($subject));
  $email_body = $invite->field_invitation_email_body[LANGUAGE_NONE][0]['safe_value'];
  $message['body'][] = $email_body;
}