GET /newsletter_subscriptions/1
 GET /newsletter_subscriptions/1.xml
173436
def show
      @newsletter_subscription = Cmtool::NewsletterSubscription.find(params[:id])

      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @newsletter_subscription }
      end
    end
1303110
def subscribers(self, date="", page=1, page_size=1000, order_field="email", order_direction="asc", include_tracking_information=False):
        """"""
        params = {
            "date": date,
            "page": page,
            "pagesize": page_size,
            "orderfield": order_field,
            "orderdirection": order_direction,
            "includetrackinginformation": include_tracking_information
        }
        response = self._get(self.uri_for("active"), params=params)
        return json_to_py(response)
1069433
public function siteCampagnes($site_id)
    {
        if(config('newsletter.multi')) {
            $newsletters = $this->newsletter->getSite($site_id);
            return $newsletters->map(function ($newsletter, $key) {
                return $newsletter->campagnes;
            })->flatten(1);
        }

        return null;
    }
563390
protected function registerSubscribeService(){

        $this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterSubscriptionInterface', function()
        {
            return new \designpond\newsletter\Newsletter\Repo\NewsletterSubscriptionEloquent(
                new \designpond\newsletter\Newsletter\Entities\Newsletter_subscriptions
            );
        });
    }
1083570
def organization_subscription_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/organization_subscriptions/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
598722
public function subscribe(SubscribeRequest $request)
    {
        $subscribe = $this->subscription->findByEmail($request->input('email'));

        if($subscribe)
        {
            if(!$subscribe->activated_at)
            {
                alert()->warning('Cet email existe déjà');

                return redirect('/')->withInput()->with('resend', true);
            }

            $subscriptions = $subscribe->subscriptions->pluck('id')->all();

            if(in_array($request->input('newsletter_id'),$subscriptions))
            {
                alert()->warning('Vous êtes déjà inscrit à la newsletter');

                return redirect($request->input('return_path', '/'));
            }
        }
        else
        {
            // Subscribe user with activation token to website list and sync newsletter abos
            $subscribe = $this->subscription->create(['email' => $request->input('email'), 'activation_token' => md5($request->email.\Carbon\Carbon::now()) ]);
        }

        $subscribe->subscriptions()->attach($request->input('newsletter_id'));

        \Mail::send('newsletter::Email.confirmation', array('token' => $subscribe->activation_token, 'newsletter_id' => $request->input('newsletter_id')), function($message) use ($subscribe)
        {
            $message->to($subscribe->email, $subscribe->email)->subject('Inscription!');
        });

        alert()->success('<strong>Merci pour votre inscription!</strong><br/>Veuillez confirmer votre adresse email en cliquant le lien qui vous a été envoyé par email');

        return redirect($request->input('return_path', '/'));
    }
982652
protected function getSubscriberList()
	{
		$subscribers = $this->getCurrentSubscribers();

		$url = $this->argument('url');

		if ( ! starts_with($url, ['http://', 'https://']))
		{
			$url = $this->laravel['url']->to($url);
		}

		$subscribers[] = array('url' => $url);

		return $subscribers;
	}
1359262
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        return getSubscriptions(null, null);
    }
711654
def help_center_section_subscriptions(self, section_id, locale=None, **kwargs):
        ""
        api_path = "/api/v2/help_center/sections/{section_id}/subscriptions.json"
        api_path = api_path.format(section_id=section_id)
        if locale:
            api_opt_path = "/api/v2/help_center/{locale}/sections/{section_id}/subscriptions.json"
            api_path = api_opt_path.format(section_id=section_id, locale=locale)
        return self.call(api_path, **kwargs)
97669
protected function registerEmailService(){

        $this->app->singleton('designpond\newsletter\Newsletter\Repo\NewsletterEmailInterface', function()
        {
            return new \designpond\newsletter\Newsletter\Repo\NewsletterEmailEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter_emails() );
        });
    }
110928
private function processGeneralSubscription()
    {
        $customerId = $this->customerSession->getCustomerId();
        if ($customerId === null) {
            $this->messageManager->addError(__('Something went wrong while saving your subscription.'));
        } else {
            try {
                $customer = $this->customerRepository->getById($customerId);
                $storeId = $this->helper->storeManager->getStore()->getId();
                $customer->setStoreId($storeId);
                $isSubscribedState = $customer->getExtensionAttributes()
                    ->getIsSubscribed();
                $isSubscribedParam = (boolean)$this->getRequest()
                    ->getParam('is_subscribed', false);
                if ($isSubscribedParam !== $isSubscribedState) {
                    $this->customerRepository->save($customer);
                    if ($isSubscribedParam) {
                        $subscribeModel = $this->subscriberFactory->create()
                            ->subscribeCustomerById($customerId);
                        $subscribeStatus = $subscribeModel->getStatus();
                        if ($subscribeStatus == Subscriber::STATUS_SUBSCRIBED) {
                            $this->messageManager->addSuccess(__('We have saved your subscription.'));
                        } else {
                            $this->messageManager->addSuccess(__('A confirmation request has been sent.'));
                        }
                    } else {
                        $this->subscriberFactory->create()
                            ->unsubscribeCustomerById($customerId);
                        $this->messageManager->addSuccess(__('We have removed your newsletter subscription.'));
                    }
                } else {
                    $this->messageManager->addSuccess(__('We have updated your subscription.'));
                }
            } catch (\Exception $e) {
                $this->messageManager->addError(__('Something went wrong while saving your subscription.'));
            }
        }
    }
1037651
def retrieve(cls, *args, **kwargs):
        """"""
        return super(Subscription, cls).retrieve(*args, **kwargs)
740304
def fetch(self, subscription_id, data={}, **kwargs):
        "
        return super(Subscription, self).fetch(subscription_id, data, **kwargs)
479511
def _extract_subscription_url(url):
    
    match = re.match(r".*/subscriptions/[a-f0-9-]+/", url, re.IGNORECASE)
    if not match:
        raise ValueError("Unable to extract subscription ID from URL")
    return match.group(0)
1111008
def subscribe(self, subscription):
        """"""
        url = urljoin(self._url, '/subscriptions')
        return subscription.post(url)
1267232
def getEndpointSubscriptions(self,ep):
		'''
		
		'''
		result = asyncResult()
		result.endpoint = ep
		data = self._getURL("/subscriptions/"+ep)
		if data.status_code == 200: #immediate success
			result.error = False
			result.is_done = True
			result.result = data.content
		else:
			result.error = response_codes("unsubscribe",data.status_code)
			result.is_done = True
		result.raw_data = data.content
		result.status_code = data.status_code
		return result
945865
public function getRepositorySubscription(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/subscription',
            $this->getActivity()->getOwner(), $this->getActivity()->getRepo()));
    }