You are here

function _library_mail_text in Library 6

Same name and namespace in other branches
  1. 5.2 library.actions.inc \_library_mail_text()
  2. 6.2 library.module \_library_mail_text()
  3. 7 library.module \_library_mail_text()
2 calls to _library_mail_text()
library_admin_settings_overdue in ./library.admin.inc
Menu callback: Edit Library Overdue Settings.
library_mail in ./library.actions.inc
Implementation of hook_mail()

File

./library.module, line 1487

Code

function _library_mail_text($key, $language = NULL, $variables = array()) {
  $langcode = isset($language) ? $language->language : NULL;
  if ($admin_setting = variable_get('library_mail_' . $key, FALSE)) {

    // An admin setting overrides the default string.
    return strtr($admin_setting, $variables);
  }
  else {

    // No override, return default string.
    switch ($key) {
      case 'notify_overdue_subject':
        return t('Overdue Items for !patronname at !site', $variables, $langcode);
      case 'notify_overdue_body':
        return t("!patronname,\n\nThank you for using !site. You have one or more items that are overdue. You can find a list of overdue items below. \n\n!items\n\nPlease return these items as soon as possible. \n\nThank you!", $variables, $langcode);
    }
  }
}