You are here

public function SubscriberInterface::subscribe in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/SubscriberInterface.php \Drupal\simplenews\SubscriberInterface::subscribe()
  2. 3.x src/SubscriberInterface.php \Drupal\simplenews\SubscriberInterface::subscribe()

Add a subscription to a certain newsletter to the subscriber.

Parameters

string $newsletter_id: The ID of a newsletter.

int $status: The status of the subscription.

string $source: The source where the subscription comes from.

int $timestamp: The timestamp of when the subscription was added.

1 method overrides SubscriberInterface::subscribe()
Subscriber::subscribe in src/Entity/Subscriber.php
Add a subscription to a certain newsletter to the subscriber.

File

src/SubscriberInterface.php, line 175

Class

SubscriberInterface
Provides an interface defining a contant message entity

Namespace

Drupal\simplenews

Code

public function subscribe($newsletter_id, $status = SIMPLENEWS_SUBSCRIPTION_STATUS_SUBSCRIBED, $source = 'unknown', $timestamp = REQUEST_TIME);