You are here

function party_simplenews_entity_delete in Party 8.2

Implements hook_entity_delete()

File

modules/party_simplenews/party_simplenews.module, line 347
Main module file for Party Simplenews integration

Code

function party_simplenews_entity_delete($entity, $type) {
  if ($type == 'party') {
    $subscribers = party_simplenews_subscriber_load_by_pid($entity->pid);
    if (!$subscribers) {
      return;
    }
    foreach ($subscribers as $subscriber) {
      simplenews_subscriber_delete($subscriber);
    }
  }
}