Part of lp.services.mail.interfaces View In Hierarchy
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. |
Returns | An iterator of IPerson , sorted by display name. |
Returns | An iterator of (email_address , IPerson ), unsorted. |
Return true if person or email is in the notification recipients list.
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.
Parameters | person_or_email | An IPerson or email address that is in the
recipients list. |
Raises | UnknownRecipientError | if the person or email isn't in 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.
Parameters | person | The IPerson or a sequence of IPerson
that will be notified. |
reason | The rationale message that should appear in the notification footer. | |
header | The code that will appear in the X-Launchpad-Message-Rationale header. |
Parameters | person | The IPerson or a sequence of IPerson
that will removed from the recipients list. |
The rationale for recipient already in this set will not be updated.
Parameters | recipient_set | An INotificationRecipientSet . |