Merge pull request #1381 from colemanw/ccJs
[civicrm-core.git] / api / v3 / MailingEventUnsubscribe.php
index 485651985a8f0913f612164697bac17e8e422105..53a624bcc3a8b553d15bdca08f1fa6ba57c62354 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-// $Id$
 
 /*
  +--------------------------------------------------------------------+
  */
 function civicrm_api3_mailing_event_unsubscribe_create($params) {
 
-  $job   = $params['job_id'];
+  $job = $params['job_id'];
   $queue = $params['event_queue_id'];
-  $hash  = $params['hash'];
+  $hash = $params['hash'];
   if (empty($params['org_unsubscribe'])) {
     $groups = CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_mailing($job, $queue, $hash);
     if (count($groups)) {
       CRM_Mailing_Event_BAO_Unsubscribe::send_unsub_response($queue, $groups, FALSE, $job);
       return civicrm_api3_create_success($params);
     }
-    if (!groups) {}
   }
   else {
     $unsubs = CRM_Mailing_Event_BAO_Unsubscribe::unsub_from_domain($job, $queue, $hash);
@@ -77,7 +75,7 @@ function civicrm_api3_mailing_event_unsubscribe_create($params) {
 
 /**
  * Adjust Metadata for Create action
- * 
+ *
  * The metadata is used for setting defaults, documentation & validation
  * @param array $params array or parameters determined by getfields
  */