Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Message Stack in Drupal

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Message Stack in Drupal

Managing activity streams, notifications, subscriptions in a Drupal way

Avatar for Paolo Libanore

Paolo Libanore

November 19, 2014

Other Decks in Technology

Transcript

  1. ABOUT US Paolo Libanore Web Area Manager 
 Sixeleven
 @paololibanore

    2 Italo Mairo Senior Drupal Developer 
 Sixeleven

  2. MESSAGE STACK https://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
  3. 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.
  4. 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
  5. DISTRO USING MESSAGE Message stack is widely used by several

    distributions orders logging and notifications activity streams and notifications activity streams and notifications
  6. 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
  7. MESSAGE STACK The 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
  8. 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”
  9. 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
  10. 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
  11. WHAT IS A MESSAGE • message is an entity •

    fieldable • token support • leverages view modes • translatable
  12. 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
  13. SUBSCRIBERS NOTIFICATION after creating the message, custom module shall invoke:

    message_subscribe_send_messages()
 with this command the message_subscribe module handles: • get basic context
 i.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
  14. LET USER CHOOSE By 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
  15. BONUS • Message subscribe queue • Message auto purge •

    Message digest:
 send notification once a day/week • Organic groups integration