dday2014 - message stack: gestire activity streams, notifiche, sottoscrizioni in a drupal way

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

Upload: drupalday

Post on 13-Jul-2015

133 views

Category:

Technology


2 download

TRANSCRIPT

MESSAGE STACK

managing activity streams, notifications, subscriptions in a Drupal way

ABOUT USPaolo Libanore

Web Area Manager Sixeleven @paololibanore

2

Italo Mairo

Senior Drupal Developer Sixeleven

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

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.

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

DISTRO USING MESSAGEMessage stack is widely used by several distributions

orders logging and notifications

activity streams and notifications

activity streams and notifications

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

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

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

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”

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

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

WHAT IS A MESSAGE

• message is an entity

• fieldable

• token support

• leverages view modes

• translatable

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

ACTIVITY STREAM DEMO

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

NOTIFICATIONS DEMO

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

BONUS• Message subscribe queue

• Message auto purge

• Message digest:send notification once a day/week

• Organic groups integration

THANK YOU!

www.sixeleven.it