l.s.m.i.INotificationRecipientSet(Interface) : interface documentation

Part of lp.services.mail.interfaces View In Hierarchy

Represents a set of notification recipients and rationales.

All Launchpad emails should include a footer explaining why the user is receiving the email. An INotificationRecipientSet encapsulates a list of recipients along the rationale for being on the recipients list.

The pattern for using this are as follows: email addresses in an INotificationRecipientSet are being notified because of a specific event (for instance, because a bug changed). The rationales describe why that email addresses is included in the recipient list, detailing subscription types, membership in teams and/or other possible reasons.

The set maintains the list of IPerson that will be contacted as well as the email address to use to contact them.

Method getEmails Return all email addresses registered, sorted alphabetically.
Method getRecipients Return the set of person who will be notified.
Method getRecipientPersons Return the set of individual Persons who will be notified.
Method __iter__ Return an iterator of the recipients.
Method __contains__ Is person_or_email in the notification recipients list?
Method __nonzero__ Return False when the set is empty, True when it's not.
Method getReason Return a reason tuple containing (text, header) for an address.
Method add Add a person or a sequence of persons to the recipients list.
Method remove Remove a person or a list of persons from the recipients list.
Method update Updates this instance's reasons with reasons from another set.
def getEmails():
Return all email addresses registered, sorted alphabetically.
def getRecipients():
Return the set of person who will be notified.
ReturnsAn iterator of IPerson, sorted by display name.
def getRecipientPersons():
Return the set of individual Persons who will be notified.
ReturnsAn iterator of (email_address, IPerson), unsorted.
def __iter__():
Return an iterator of the recipients.
def __contains__(person_or_email):
Is person_or_email in the notification recipients list?

Return true if person or email is in the notification recipients list.

def __nonzero__():
Return False when the set is empty, True when it's not.
def getReason(person_or_email):
Return a reason tuple containing (text, header) for an address.

The text is meant to appear in the notification footer. The header should be a short code that will appear in an X-Launchpad-Message-Rationale header for automatic filtering.

Parametersperson_or_emailAn IPerson or email address that is in the recipients list.
RaisesUnknownRecipientErrorif the person or email isn't in the recipients list.
def add(person, reason, header):
Add a person or a sequence of persons to the recipients list.

When the added person is a team without an email address, all its members emails will be added. If the person is already in the recipients list, the reason for contacting them is not changed.

ParameterspersonThe IPerson or a sequence of IPerson that will be notified.
reasonThe rationale message that should appear in the notification footer.
headerThe code that will appear in the X-Launchpad-Message-Rationale header.
def remove(person):
Remove a person or a list of persons from the recipients list.
ParameterspersonThe IPerson or a sequence of IPerson that will removed from the recipients list.
def update(recipient_set):
Updates this instance's reasons with reasons from another set.

The rationale for recipient already in this set will not be updated.

Parametersrecipient_setAn INotificationRecipientSet.
API Documentation for Launchpad, generated by pydoctor at 2019-05-27 00:00:04.