/** * Adds new subscriber to the mailchimp list * * Works only if the license is new (checks for the empty id) * * @param License $license */ public function addToList(License $license) { if (!$this->enabled) { return; } foreach ($this->lists as $list) { if ($license->isNew() && $license->getAddonKey() == $list['addon_key']) { $this->add($list['list_id'], $license); } } }