public function listremoveAction($listname) { $mailgun = new Mailgun($this->private_key, $this->APIURL, "v3", true); $listAddress = $listname . $this->GROUPEMAIL; $result = $mailgun->delete("lists/{$listAddress}"); return $this->JsonResponse($result); }
function mg_delete_subscriber($email_id) { $key = get_instance()->config->item('mailgun_key'); $mg = new Mailgun($key); $list_address = get_instance()->config->item('newsletter_address'); # Issue the call to the client. $result = $mg->delete("lists/{$list_address}/members/{$email_id}"); }