ProMailerSubscribers class

Copyright 2019 by Ryan Cramer

This is a commercial module, do not distribute.

HOOKS CALLED BEFORE AN EVENT

(these hooks can set $event->return to false to cancel an event)

HOOKS CALLED AFTER SUCCESS

BOUNCE-RELATED HOOKS

CONFIRMATION CODE-RELATED HOOKS

OTHER METHOD HOOKS


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the ProMailerSubscribers class also inherits all the methods and properties of: ProMailerTypeManager and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
ProMailerSubscribers::add(string $email, $list)
ProMailerSubscriber bool int

Add a subscriber to a subscribers list

 
ProMailerSubscribers::addReady(string $email, ProMailerList $list, bool $confirmed, array $data)
bool

Ready to add new subscriber

ProMailerSubscribers::added(ProMailerSubscriber $subscriber)
None

New subscriber added

ProMailerSubscribers::bounce($subscriber)
int

Record a bounce for an email address or a subscriber in a list

 
ProMailerSubscribers::confirmEmail(string $email, $list, string $code)
bool

Confirm a subscriber as opt-in for a list

 
ProMailerSubscribers::confirmEmailReady(string $email, ProMailerList $list, string $code)
bool

Ready to confirm an email

ProMailerSubscribers::confirmedEmail(string $email, ProMailerList $list, string $code)
None

Email confirmed

ProMailerSubscribers::copyAll(ProMailerList $list1, ProMailerList $list2)
array

Copy all subscribers from list1 into list2

 
ProMailerSubscribers::count()
int

Return total count of subscribers for given list

 
ProMailerSubscribers::exportCSV($listId)
None

Export subscribers to CSV download

 
ProMailerSubscribers::find()
ProMailerSubscribersArray int

Get current pagination (limit=100) of subscribers for given list

 
ProMailerSubscribers::get($id)
ProMailerSubscriber bool

Get a subscriber by email or ID

 
ProMailerSubscribers::getAllowedSorts()
array

Get fields allowed for sorting of subscribers

 
ProMailerSubscribers::getByEmail(string $email)
bool array ProMailerSubscriber

Given an email address return the subscriber or boolean false if not found

 
ProMailerSubscribers::getById(int $id)
bool ProMailerSubscriber

Get a subscriber by ID

 
ProMailerSubscribers::getCode($subscriber)
string

Get the confirmation code for given subscriber array or Page

 
ProMailerSubscribers::getConfirmUrl(ProMailerSubscriber $subscriber)
string

Get the URL needed to confirm a subscriber

 
ProMailerSubscribers::getDefaultSort()
string

Get default sort for subscribers

 
ProMailerSubscribers::getNext($list)
ProMailerSubscriber bool null

Get the next subscriber for the given list

 
ProMailerSubscribers::getPageEmailField($list)
string

Get name of field used for email address on subscriber pages

 
ProMailerSubscribers::getPageTemplates($list)
array

Get array of template names used by subscriber pages

 
ProMailerSubscribers::getUnsubscribeUrl($subscriber)
string

Get the URL to unsubscribe a particular subscriber from their list

 
ProMailerSubscribers::importCSV(string $csvFile, $list)
array bool

Import subscribers from given CSV file

 
ProMailerSubscribers::install()
None 
ProMailerSubscribers::pageSelector($list)
string array

Return selector for finding subscribers from given list

 
ProMailerSubscribers::pageToSubscriber(Page $page, $list)
ProMailerSubscriber

Convert Page to a subscriber array

 
ProMailerSubscribers::removeUnconfirmed()
int

Remove subscribers that haven’t been confirmed for given number of days

 
ProMailerSubscribers::save(ProMailerSubscriber $subscriber)
bool

Save/update the given subscriber

 
ProMailerSubscribers::saveLog(string $str)
None

Save entry to subscribers log

 
ProMailerSubscribers::saveLogDisabled()
bool

Disable or enable logging or return current state if given no argumenets

 
ProMailerSubscribers::saveReady(ProMailerSubscriber $subscriber, array $properties)
bool

Subscriber ready to save

ProMailerSubscribers::saved(ProMailerSubscriber $subscriber, array $properties)
None

Subscriber saved

ProMailerSubscribers::table()
None 
ProMailerSubscribers::unsubscribe($subscriber, $list)
bool

Remove a subscriber from a list

 
ProMailerSubscribers::unsubscribeAllFromList(ProMailerList $list)
int

Remove all subscribers from a list

ProMailerSubscribers::unsubscribed(ProMailerSubscriber $subscriber, ProMailerList $list)
None

Subscriber removed from list

ProMailerSubscribers::unsubscribedEmail(string $email)
None

Email address removed from ALL lists

ProMailerSubscribers::unsubscribedPage(Page $subscriber, ProMailerList $list)
None

Page-based subscriber unsubscribed from pages-type list

ProMailerSubscribers::upgrade($fromVersion, $toVersion)
None 

Additional methods and properties

In addition to the methods and properties above, ProMailerSubscribers also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.253