Drupal Website Development, Drupal website Design, Drupal, Drupal developer
Message Stack in Drupal
-
Upload
paolo-libanore -
Category
Internet
-
view
1.386 -
download
4
Transcript of Message Stack in Drupal
![Page 1: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/1.jpg)
MESSAGE STACK
managing activity streams, notifications, subscriptions in a Drupal way
![Page 2: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/2.jpg)
ABOUT USPaolo Libanore
Web Area Manager Sixeleven @paololibanore
2
Italo Mairo
Senior Drupal Developer Sixeleven
![Page 3: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/3.jpg)
MESSAGE STACKhttps://www.drupal.org/project/message
Mantainer: Amitaibu
“The Message module is the core of the message stack. It enables logging and displaying system events in a number of different use cases.”
With Message Notify, Flag and Message Subscribe modules the website can send out notifications, and allow users to subscribe or unsubscribe to notifications
![Page 4: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/4.jpg)
MESSAGES VALUE
Messages improve communication:
• They help your site interact with people.
• They help people interact with your site.
• They help people interact with other people.
![Page 5: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/5.jpg)
MESSAGES SAMPLES
• John commented on X article
• John started following Paul
• Phil just became a member
• There’s a new Y article in Z category
![Page 6: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/6.jpg)
DISTRO USING MESSAGEMessage stack is widely used by several distributions
orders logging and notifications
activity streams and notifications
activity streams and notifications
![Page 7: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/7.jpg)
OUR CASE STUDY
• Client:
• Project:
• Internal community platform to improve communication among 800 staff spread out in the world local offices
• Message stack key features: activity streams + notifications
![Page 8: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/8.jpg)
![Page 9: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/9.jpg)
MESSAGE HANDBOOKDrupal Project Documentation:https://www.drupal.org/node/2180145
![Page 10: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/10.jpg)
MESSAGE STACKThe message stack comprises three main modules:
• defines message entity types (fieldable) and let you create messages instances with dynamic content
• handles delivery of a specific message notification through specialized plugins (e-mail, sms, …)
• given a new message identifies the recipients/subscribers through flag module and pass the message to message notify module for delivery
![Page 11: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/11.jpg)
FLAG MODULE
https://www.drupal.org/project/flag
“Using this module, the site administrator can provide any number of flags for nodes, comments, users, and any other type of entity. Some possibilities include bookmarks, marking important, friends, or flag as offensive”
![Page 12: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/12.jpg)
MAIN USE CASES
1. Activity stream / News feed
2. Notifications: users who subscribe to content will be notified when events occur that involve that content
![Page 13: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/13.jpg)
OUT OF THE BOX READY?
not exactly
• the 3 modules expose API to other modules
• pluggable architecture that supports customization and extensibility
• but … to let you understand, the 3 modules includes features and example modules to easily test the workflow
![Page 14: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/14.jpg)
WHAT IS A MESSAGE
• message is an entity
• fieldable
• token support
• leverages view modes
• translatable
![Page 15: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/15.jpg)
ACTIVITY STREAM
Messages can be created through:
• Custom code: Hooks
• Via UI: Rules
Message example (message_example: feature available in message_module), exposes:
• message types
• example of view
• custom code that hooks events and creates messages
![Page 16: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/16.jpg)
ACTIVITY STREAM DEMO
![Page 17: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/17.jpg)
SUBSCRIBERS NOTIFICATION
after creating the message, custom module shall invoke:
message_subscribe_send_messages()
with this command the message_subscribe module handles:
• get basic contexti.e..the node of the comment, the author of the comment and node, the terms and the groups
• get subscribers (people who flagged)
• pass to message_notify
![Page 18: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/18.jpg)
NOTIFICATIONS DEMO
![Page 19: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/19.jpg)
LET USER CHOOSEBy default message subscribe send the
notification to all the users that subscribed content
With message_subscribe_email module we can let user define its email preference
for every subscribed content
![Page 20: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/20.jpg)
BONUS• Message subscribe queue
• Message auto purge
• Message digest:send notification once a day/week
• Organic groups integration
![Page 22: Message Stack in Drupal](https://reader035.fdocuments.us/reader035/viewer/2022062710/55a1b7241a28abf1398b4676/html5/thumbnails/22.jpg)