You are here

function _event_calendar_email_text in Event Calendar 7

Returns a mail string for a variable name.

3 calls to _event_calendar_email_text()
event_calendar_node_insert in ./event_calendar.module
Implements hook_node_insert().
event_calendar_node_update in ./event_calendar.module
Implements hook_node_update().
event_calendar_settings in ./event_calendar.admin.inc
Menu callback: Event Calendar configuration.

File

./event_calendar.module, line 194
The module file that allows events to be created and required admin approval.

Code

function _event_calendar_email_text($key) {
  if ($admin_setting = variable_get('event_calendar_email_' . $key, FALSE)) {

    // An admin setting overrides the default string.
    $text = $admin_setting;
  }
  else {

    // No override, return default string.
    switch ($key) {
      case 'admin_body':
        $text = t("Hello,\n\nA new event [node:title] is created at [site:name].\n\nStart Date: [event_calendar:start_date]\nEnd Date: [event_calendar:end_date]\nPlease give your approval to sucessfully organize this event at [event_calendar:approval_url].\n\n\n--  [site:name] team");
        break;
      case 'users_body':
        $text = t("Hello,\n\nA new event [node:title] is created at [site:name].\n\nStart Date: [event_calendar:start_date]\nEnd Date: [event_calendar:end_date]\nPlease give your approval to sucessfully organize this event at [event_calendar:approval_url].\n\n\n--  [site:name] team");
        break;
      case 'admin_subject':
        $text = t("New Event: [node:title]");
        break;
      case 'users_subject':
        $text = t("New Event: [node:title]");
        break;
    }
  }
  return $text;
}