You are here

function regcode_mailer_mail in Registration codes 7

Same name and namespace in other branches
  1. 6.2 regcode_mailer/regcode_mailer.module \regcode_mailer_mail()
  2. 6 regcode_mailer/regcode_mailer.module \regcode_mailer_mail()
  3. 7.2 regcode_mailer/regcode_mailer.module \regcode_mailer_mail()

Implements hook_mail().

File

regcode_mailer/regcode_mailer.module, line 157
Main code functionality and hooks of regcode_mailer module.

Code

function regcode_mailer_mail($key, &$message, $params) {
  switch ($key) {
    case 'regcode':
      $token_data = array(
        'regcode' => $params['regcode'],
      );
      $message['subject'] = token_replace($params['subject'], $token_data);
      $message['body'][] = token_replace($params['message'], $token_data);
      break;
  }
}