PA_NewsletterTypeSubscriber
in package
The PuzzleAnywhere NewsletterTypeSubscriber class. It allows for retrieving newsletter type subscription data, as well as confirming and unsubscribing from newsletter types. This is not related to user subscription information, unless the newsletter type is paywalled to subscribers only.
Table of Contents
- $accepted_at : string
- The datetime the user accepted the subscription.
- $bounced_at : string
- The latest datetime when an email sent to the user bounced.
- $id : int
- The `NewsletterTypeSubscriber` ID.
- $newsletter_type_id : int
- The current calendar integer month.
- $pending_at : string
- The datetime when an acceptance email was sent to the user.
- $status : string
- The status of the user subscription.
- $subscriber_email : string
- The newsletter type subscriber's email address.
- $subscription_token : string
- The newsletter token for the subscriber record.
- $unsubscribed_at : string
- The datetime the user subscribed at.
- $user : PA_User
- The user record.
- confirm_subscription() : PA_NewsletterTypeSubscriber
- Confirms a pending newsletter type subscription for a user via a token-based URL.
- has_unsubscribed() : bool
- Denotes whether the state of the `NewsletterTypeSubscriber` has explicitly unsubscribed.
- is_subscribed() : bool
- Denotes whether the state of the `NewsletterTypeSubscriber` is subscribed.
- unsubscribe() : PA_NewsletterTypeSubscriber
- Allows a user to unsubscribe from newsletter type subscription via a token-based URL.
Properties
$accepted_at
The datetime the user accepted the subscription.
public
string
$accepted_at
The datetime the user accepted the subscription.
$bounced_at
The latest datetime when an email sent to the user bounced.
public
string
$bounced_at
The latest datetime when an email sent to the user bounced.
$id
The `NewsletterTypeSubscriber` ID.
public
int
$id
The NewsletterTypeSubscriber ID.
$newsletter_type_id
The current calendar integer month.
public
int
$newsletter_type_id
The current calendar integer month.
$pending_at
The datetime when an acceptance email was sent to the user.
public
string
$pending_at
The datetime when an acceptance email was sent to the user.
$status
The status of the user subscription.
public
string
$status
The status of the user subscription. [unsubscribed|bounced|pending|accepted]
$subscriber_email
The newsletter type subscriber's email address.
public
string
$subscriber_email
The newsletter type subscriber's email address.
$subscription_token
The newsletter token for the subscriber record.
public
string
$subscription_token
The newsletter token for the subscriber record.
$unsubscribed_at
The datetime the user subscribed at.
public
string
$unsubscribed_at
The datetime the user subscribed at.
$user
The user record.
public
PA_User
$user
The user record.
Methods
confirm_subscription()
Confirms a pending newsletter type subscription for a user via a token-based URL.
public
static confirm_subscription(int $newsletter_type_id, string $token) : PA_NewsletterTypeSubscriber
Parameters
- $newsletter_type_id : int
-
The newsletter type ID.
- $token : string
-
The unique token to confirm the subscription.
Return values
PA_NewsletterTypeSubscriber —has_unsubscribed()
Denotes whether the state of the `NewsletterTypeSubscriber` has explicitly unsubscribed.
public
has_unsubscribed() : bool
Return values
bool —Returns true if user has unsubcsribed.
is_subscribed()
Denotes whether the state of the `NewsletterTypeSubscriber` is subscribed.
public
is_subscribed() : bool
Return values
bool —Returns true if subscribed.
unsubscribe()
Allows a user to unsubscribe from newsletter type subscription via a token-based URL.
public
static unsubscribe(int $newsletter_type_id, string $token) : PA_NewsletterTypeSubscriber
Parameters
- $newsletter_type_id : int
-
The newsletter type ID.
- $token : string
-
The unique token to unsubscribe.