You are here

function _signup_event_reminder_sql in Signup 6

Same name and namespace in other branches
  1. 5.2 includes/event.5x-1.inc \_signup_event_reminder_sql()
  2. 5.2 includes/event.5x-2.inc \_signup_event_reminder_sql()
  3. 6.2 includes/event.6x-2.inc \_signup_event_reminder_sql()
  4. 7 includes/event.6x-2.inc \_signup_event_reminder_sql()

Return value

Array of SQL clauses for cron reminder email query builder.

1 call to _signup_event_reminder_sql()
signup_reminder_sql in includes/scheduler.inc

File

includes/event.6x-2.inc, line 8

Code

function _signup_event_reminder_sql($content_type) {
  global $db_type;
  event_include_files();
  switch ($db_type) {
    case 'mysql':
    case 'mysqli':
      $where = array(
        "('" . gmdate('Y-m-d H:i:s') . "' > (" . event_where_utc() . " - INTERVAL s.reminder_days_before DAY))",
        "('" . gmdate('Y-m-d H:i:s') . "' <= (" . event_where_utc() . "))",
      );
      break;
    case 'pgsql':
      $where = array(
        "('" . gmdate('Y-m-d H:i:s') . "' > (" . event_where_utc() . " - INTERVAL 's.reminder_days_before days'))",
        "('" . gmdate('Y-m-d H:i:s') . "' <= (" . event_where_utc() . "))",
      );
      break;
  }
  return array(
    'fields' => array(
      event_select(),
      'e.timezone',
    ),
    'joins' => array(
      event_join(),
    ),
    'where' => $where,
  );
}