You are here

function activity_send_email_uninstall in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  2. 8 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  3. 8.2 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  4. 8.3 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  5. 8.4 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  6. 8.6 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  7. 8.7 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  8. 8.8 modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  9. 10.3.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  10. 10.0.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  11. 10.1.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()
  12. 10.2.x modules/custom/activity_send/modules/activity_send_email/activity_send_email.install \activity_send_email_uninstall()

Implements hook_uninstall().

Removes keys from the State API.

File

modules/custom/activity_send/modules/activity_send_email/activity_send_email.install, line 15
Install, update and uninstall functions for the activity_send_email module.

Code

function activity_send_email_uninstall() {

  // Get plugins and their intervals.
  $emailfrequencymanager = \Drupal::service('plugin.manager.emailfrequency');
  $plugins = $emailfrequencymanager
    ->getDefinitions();

  // Remove all cron last run times from the State API.
  foreach ($plugins as $frequency) {
    \Drupal::state()
      ->delete('digest.' . $frequency['id'] . '.last_run');
  }
}