You are here

function ed_classified_mail in Classified Ads 5

Same name and namespace in other branches
  1. 5.2 ed_classified.module \ed_classified_mail()
  2. 6.2 ed_classified.module \ed_classified_mail()
  3. 7.2 ed_classified.module \ed_classified_mail()

Implementation of hook_mail()

File

./ed_classified.module, line 839
Simple text-based classified ads module. Michael Curry, Exodus Development, Inc. exodusdev@gmail.com for more information, please visit http://exodusdev.com/drupal/modules/classified.module Copyright (c) 2006, 2007 Exodus Development, Inc. All Rights…

Code

function ed_classified_mail($key, &$message, $params) {
  $language = $message['language'];
  $variables = array_merge(user_mail_tokens($params['account'], $language), $params['context']);
  switch ($key) {
    case 'expired':
      $message['subject'] = t(EDI_CLASSIFIED_VAR_DEF_EXP_EMAIL_SUBJ, $variables, $language->language);
      $message['body'][] = t(EDI_CLASSIFIED_VAR_DEF_EXP_EMAIL_BODY, $variables, $language->language);
      break;
    case 'expiring':
      $message['subject'] = t(EDI_CLASSIFIED_VAR_DEF_EMAIL_SUBJ, $variables, $language->language);
      $message['body'][] = t(EDI_CLASSIFIED_VAR_DEF_EMAIL_BODY, $variables, $language->language);
      break;
    default:
      $message['subject'] = t('Classified Ad notification from !site', $variables, $language->language);
      break;
  }
}