/** * Unsubscribe the current {@link Member} from * a newsletter. * * @TODO It's unclear where this is used. * * @param NewsletterType $newsletterType Newsletter type to unsubscribe from */ function unsubscribeFromNewsletter($newsletterType) { $unsubscribeRecord = new UnsubscribeRecord(); $unsubscribeRecord->unsubscribe($this->owner, $newsletterType); $this->owner->Groups()->remove($newsletterType->GroupID); }
protected function unsubscribeFromLists($recipient, $lists, &$recordsIDs) { if ($lists && $lists->count()) { foreach ($lists as $list) { $recipient->Mailinglists()->remove($list); $unsubscribeRecord = new UnsubscribeRecord(); $unsubscribeRecord->unsubscribe($recipient, $list); $recordsIDs[] = $unsubscribeRecord->ID; } } }
protected function unsubscribeFromList($member, $list) { // track unsubscriptions $member->Groups()->remove($list->GroupID); $unsubscribeRecord = new UnsubscribeRecord(); $unsubscribeRecord->unsubscribe($member, $list); }