internal package Foswiki::Contrib::MailerContrib::Subscriber

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Contrib::MailerContrib::Subscriber

Object that represents a subscriber to notification. A subscriber is a name (which may be a wikiName or an email address) and a list of subscriptions which describe the topis subscribed to, and unsubscriptions representing topics they are specifically not interested in. The subscriber name may also be a group, so it may expand to many email addresses.

ClassMethod new($name)

  • $name - Wikiname, with no web, or email address, of user targeted for notification
Create a new user.

ObjectMethod getEmailAddresses() → \@list

Get a list of email addresses for the user(s) represented by this subscription

STATIC getEmailAddressesForUser() -> \@list

Get a list of email addresses for the user(s) represented by this subscription. Static method provided for use by other modules.

ObjectMethod optimise()

Optimise the lists of subscriptions and unsubscriptions by finding overlaps and eliminating them. Intended to be used before writing a new WebNotify.

ObjectMethod subscribe($subs)

  • $subs - Subscription object
Add a new subscription to this subscriber object. no optimisation is performed; if the subscription is already there, or is covered by another subscription, then it will still be added.

ObjectMethod unsubscribe($subs)

  • $subs - Subscription object
Add a new unsubscription to this subscriber object. The unsubscription will always be added, even if there is a wildcard overlap with an existing subscription or unsubscription.

An unsubscription is a statement of the subscribers desire not to be notified of changes to this topic.

isSubscribedTo($topic, $db) -> $subscription

Check if we have a subscription to the given topic. Return the subscription that matches if we do, undef otherwise.

ObjectMethod isUnsubscribedFrom($topic) → $subscription

Check if we have an unsubscription from the given topic. Return the subscription that matches if we do, undef otherwise.

ObjectMethod stringify() → string

Return a string representation of this object, in WebNotify format.

Topic revision: r1 - 21 Nov 2014, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding WikiCMC? Send feedback