Ejemplo n.º 1
0
 /**
  * Add multiple members to this mailinglist
  *
  * @param array  $members
  * @param bool   $upsert
  *
  * @return Mailinglist
  */
 public function addMembers($members = [], $upsert = false)
 {
     $upsert = $upsert ? 'yes' : 'no';
     foreach ($members as $key => $member) {
         if (!is_string($member)) {
             $members[$key] = $this->_parseMemberParams($member);
         }
     }
     $mailinglist = new Mailinglist();
     $mailinglist->setList($this->mailgun(true)->post("lists/{$this->address}/members.json", ['members' => json_encode($members), 'upsert' => $upsert])->http_response_body->list);
     return $mailinglist;
 }
Ejemplo n.º 2
0
 /**
  * Delete a member of a mailinglist
  *
  * @param string $listaddress
  * @param string $memberaddress
  *
  * @return bool
  */
 public function deleteMember($listaddress, $memberaddress)
 {
     $mailinglist = new Mailinglist($listaddress);
     $mailinglist->deleteMember($memberaddress);
     return true;
 }