December 2018
Beginner to intermediate
404 pages
10h 14m
English
Our business logic can make use of this messaging system to send notifications to users. To post a message, we use the message_post() method. The following is an example of this:
self.message_post('Hello!')
This adds a simple text message, but sends no notification to the followers. That is because, by default, the mail.mt_note subtype is used for the posted messages. But we can have the message posted with the particular subtype we want. To add a message and have it send notifications to the followers, we should use the mt_comment subtype. Another optional attribute is the message's subject. Here, is an example using both options:
self.message_post('Hello again!', subject='Hello', subtype='mail.mt_comment')
The message ...
Read now
Unlock full access