Part of lp.answers.notification View In Hierarchy
Known subclasses: lp.answers.notification.QuestionAddedNotification, lp.answers.notification.QuestionModifiedDefaultNotification, lp.answers.notification.QuestionUnsupportedLanguageNotification, lp.answers.tests.test_question_notifications.FakeQuestionNotification, lp.coop.answersbugs.subscribers.QuestionLinkedBugStatusChangeNotification
Creating an instance of that class will build the notification and send it to the appropriate recipients. That way, subclasses of QuestionNotification can be registered as event subscribers.
Method | __init__ | Base constructor. |
Method | user | Return the user from the event. |
Method | getSubject | Return the subject of the notification. |
Method | getBody | Return the content of the notification message. |
Method | getHeaders | Return additional headers to add to the email. |
Method | initialize | Initialization hook for subclasses. |
Method | shouldNotify | Return if there is something to notify about. |
Method | enqueue | Create a job to send email about the event. |
Method | unsupported_language | Whether the question language is unsupported or not. |
Method | unsupported_language_warning | Warning about the fact that the question is written in an |
It saves the question and event in attributes and then call the initialize() and send() method.
Default to [Question #dd]: Title
This method must be implemented by a subclass.
Default implementation adds a X-Launchpad-Question header.
This method is called before send() and can be use for any setup purpose.
Default does nothing.
When this method returns False, no notification will be sent. By default, all event trigger a notification.