You are here

function drush_classified_notify in Classified Ads 7.3

Same name and namespace in other branches
  1. 6.3 classified.drush.inc \drush_classified_notify()

Command callback for classified-notify. No output: nothing to return.

File

./classified.drush.inc, line 112
Drush 8 plugin for classified.module.

Code

function drush_classified_notify($kind = NULL) {
  if (!in_array($kind, _classified_get_notify_kinds())) {
    drush_set_error(dt('Incorrect notify kind: @kind', array(
      '@kind' => $kind,
    )));
    return FALSE;
  }
  module_load_include('inc', 'classified', 'classified.scheduled');
  $notify = _classified_scheduled_build_notify($kind);
  $params = _classified_drush_get_action_stats($notify);
  $params['@kind'] = $kind;
  drush_log(dt('Notifications for @kind sent to @user_count users about @node_count ads.', $params), 'success');
}