Top Banner
MESSAGE STACK managing activity streams, notifications, subscriptions in a Drupal way
22

Message Stack in Drupal

Jul 12, 2015

Download

Internet

Paolo Libanore
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Message Stack in Drupal

MESSAGE STACK

managing activity streams, notifications, subscriptions in a Drupal way

Page 2: Message Stack in Drupal

ABOUT USPaolo Libanore

Web Area Manager Sixeleven @paololibanore

2

Italo Mairo

Senior Drupal Developer Sixeleven

Page 3: Message Stack in Drupal

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

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

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

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

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
Page 9: Message Stack in Drupal

MESSAGE HANDBOOKDrupal Project Documentation:https://www.drupal.org/node/2180145

Page 10: Message Stack in Drupal

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

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

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

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

WHAT IS A MESSAGE

• message is an entity

• fieldable

• token support

• leverages view modes

• translatable

Page 15: Message Stack in Drupal

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

ACTIVITY STREAM DEMO

Page 17: Message Stack in Drupal

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

NOTIFICATIONS DEMO

Page 19: Message Stack in Drupal

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

BONUS• Message subscribe queue

• Message auto purge

• Message digest:send notification once a day/week

• Organic groups integration

Page 21: Message Stack in Drupal

THANK YOU!

www.sixeleven.it

Page 22: Message Stack in Drupal