Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add messaging system #52

Closed
BBGuy opened this issue Dec 16, 2014 · 32 comments
Closed

Add messaging system #52

BBGuy opened this issue Dec 16, 2014 · 32 comments

Comments

@BBGuy
Copy link
Member

BBGuy commented Dec 16, 2014

We need to add a messaging system that can perform the following

  • Discussion around an asset - first step for conflict resolution.
  • User to user messaging
  • Reports / smart filters - view all communications for an asset, view all communications for a user ..
@BBGuy
Copy link
Member Author

BBGuy commented Dec 18, 2014

Use the Message module

We will use the Message as this uses a fieldable entity and can be associated with users for user to user communication and with Assets for conflict resolution.
The Message module is designed for rules integration i.e. when updating an asset generate an automatic message.
For normal Messages like user to user we will need to write custom code, however we want a single system for all messages and this looks like the ideal module

Step one: Setup basic messaging

  • Start a new branch
  • Install Message & Message notify
  • Create a new Message type
  • Create a custom form for creating messages
  • Create view to view user messages
  • Look at using Message notify to send an email
  • Review access permissions for our three role types

Step two will be for asset Messaging around conflict resolution.

andystiller added a commit that referenced this issue Dec 18, 2014
and create a test module to create user messages.
@andystiller
Copy link
Contributor

I have create a custom module that adds a create message form to the user form that allows the logged in user to send a message to the selected user. I have also created a messages type that includes a message title, message body and message recipient. To view the messges I have created 2 views. The "My Messages" show the messages sent to the selected user and the "User Messages" view shows all user messages sent.

The new custom module, the message module and the message nofity module have been commited on a new 52 branch.

I have exported the "My Messages" view https://www.dropbox.com/s/d9hkwk18l66wta8/my_messages_view.txt?dl=0, "User Messages" view https://www.dropbox.com/s/kcyqudmjams2s8m/user_message_view.txt?dl=0 and the "User Message" type https://www.dropbox.com/s/kcyqudmjams2s8m/user_message_view.txt?dl=0.

@BBGuy BBGuy reopened this Dec 18, 2014
@dahacouk
Copy link
Member

Just interested why and how we are using dropbox as part of our development process? Maybe Skype Friday morning? Cheers!

@andystiller
Copy link
Contributor

Unfortunately Github doesn't allow us attach files and @BBGuy wanted views and message type exported for easy deployment . We're using Dropbox to host the exported views and message types as test files so they can be attached to this issue.

@dahacouk
Copy link
Member

Coolio!

@BBGuy BBGuy assigned andystiller and unassigned BBGuy Jan 6, 2015
@andystiller
Copy link
Contributor

I have just added a new view that will add a table of messages for the currently logged in user. This has a block and can be used on the notifications page. I have exported the view to https://www.dropbox.com/s/6r6pmwjyp7twhc5/message_notifcations_view.txt?dl=0.

andystiller added a commit that referenced this issue Jan 6, 2015
@andystiller
Copy link
Contributor

I have added email notification of user messages using the Message_notify module. After checking the code and testing I have changes the email address the message is sent ot to be the recipients email address. The email address is obtained by loading the recipient user and getting thier email address.

@andystiller
Copy link
Contributor

The Message Subscribe module requires the Flag module to be installed. It is designed to send notification messages users that events have occured on the site. It uses the flag module to flag a users interest in node. The Message Subscribe UI module provides some standards views. It requires some flags to be configured before the views can be used.

@andystiller
Copy link
Contributor

Deployment to Dev

  • merge branch 52 into dev
  • Pull code
  • Enable the Message and Message Notification modules
  • Enable the Kendra Msg module
  • Import the User Message.
  • Add the Message Title field (field name field_msg_title, Text)
  • Add the Message Body field (field name field_msg_body, Long Text)
  • Add the Message Recipient field (field name field_msg_recipient, Entity Reference, Auto Complete, User)
  • For the Manage Display change the order so it's message text, Title, Body, Recipient
  • Import the Notification view and the User Messages admin view.
  • Add the notification view to the Notifications page.
  • Configure the message display for the Email Subject and Email Body

@BBGuy
Copy link
Member Author

BBGuy commented Jan 7, 2015

Great work @andystiller below are the requirements we went over plus the next stage
Completed

  • Test and evaluate the message stack
  • Install the message and message notify
  • Create a "User Message" entity
  • Create a Contact from on user page using the "User Message"
  • Add a list of "User Message" on the notifications page.

Needs finishing

  • Email sent needs a title and a body

Next stage

  • Add a Message type field to "User Message" that can have one of two values "user" and "system" and update the user contact form to set it to "user".
  • Create an automated "System" "User Message" once a user account has been approved
  • Create an automated "System" "User Message" once a user account has been assigned the "Asset Author" role.
    The crossed out tasks would not be the best way to achieve the system messages. Please see comment below.

Notes:

  • We are likely to have additional automated messages in the future
  • On the notifications page would be good to differentiate between "System" and "User Message" and maybe provide a filter.

@BBGuy
Copy link
Member Author

BBGuy commented Jan 7, 2015

@dahacouk Now that we have user to user communications we need to think about discoverability of users, for this I have created #56

@BBGuy
Copy link
Member Author

BBGuy commented Jan 7, 2015

@andystiller you code has now been pushed to live so can be setup

  • Enable contrib and custom modules & configure message

@BBGuy
Copy link
Member Author

BBGuy commented Jan 7, 2015

@andystiller one other small issue I came across

  • After posing a message to a user the confirmation message has the ID instead of the name.

@andystiller
Copy link
Contributor

Deployment to Live

  • Pull code
  • Enable the Message and Message Notification modules
  • Enable the Kendra Msg module
  • Import the User Message.
  • Add the Message Title field (field name field_msg_title, Text)
  • Add the Message Body field (field name field_msg_body, Long Text)
  • Add the Message Recipient field (field name field_msg_recipient, Entity Reference, Auto Complete, User)
  • For the Manage Display change the order so it's message text, Title, Body, Recipient
  • Import the Notification view and the User Messages admin view.
  • Add the notification view to the Notifications page.
  • Configure the message display for the Email Subject and Email Body

@andystiller
Copy link
Contributor

The email title and body needed to be configured for the message in the message display settings.

@andystiller
Copy link
Contributor

Further work on the email system

  • Include the senders name
  • Improve the message formatting
  • Investigate special characters not being displayed properly in the the email.

@andystiller
Copy link
Contributor

The message sender (the users full name) can be included in the Message Title using Tokens provided by the Message Module. This allows the sender to beincluded inthe email subject line while leaving the sender of the message as the site email address. The other advantage is that the name also appears in the User Messages administration view.

@andystiller
Copy link
Contributor

The message body needs to be configured display as plain text to in the Manage Display (Notify - Email body). If the Message body is dispalyed with default formatting characters can get escaped (HTML codes).

@andystiller
Copy link
Contributor

Some users don't have a full name configured so for now I will make the code and the configuration use the username instead of the Full name.

@andystiller
Copy link
Contributor

System Messages

To create system messages the most flexible and easiest to congiure way would be to clode the "User Message" type and change the email /title settings so that email notifications would have the correct format. This has the other advantage of making the filtering of messages easier. It would also allow better Rules integration.

  • Clone the "User Message" type to make a "System Message" type.
  • Create an automated "System Message" once a user account has been approved
  • Create an automated "System Message" once a user account has been assigned the "Asset Author" role.

andystiller added a commit that referenced this issue Jan 8, 2015
@andystiller
Copy link
Contributor

To create the System Message it is best clone the "User Message" rather than import a new Message type as cloning creates all the fields. The Description and Mesage text should be edited after cloning.

The Account Approved and assigned Asset Author messages have been created in Rules.
https://www.dropbox.com/s/8ik1es1qt56tvku/asset_author_rule.txt?dl=0
https://www.dropbox.com/s/lpoci01nciuxn93/user_approved_rule.txt?dl=0

I have also updated the User Message administration view to include a System Message administration view.
https://www.dropbox.com/s/kcyqudmjams2s8m/user_message_view.txt?dl=0

@andystiller
Copy link
Contributor

Deploy to dev

  • push changes to dev
  • Clone "User Message" type for the System Message
  • Import Asset Author rule
  • Import Approved User rule
  • Import and overwrite the User Messages view.

Deploy to live

  • Merge dev into master
  • Clone "User Message" type for the System Message
  • Import Asset Author rule
  • Import Approved User rule
  • Import and overwrite the User Messages view.

@andystiller
Copy link
Contributor

The subject field of emails sent doesn't have a space between the message text and the message title.

  • Correct email subject formatting for User Messages
  • Correct email subject formatting for System Messages

@andystiller
Copy link
Contributor

The notification view has been updated to include system messages and the minor formatting problems have been worked around. There is a new issue #57 to handle the remaining minor formatting problems.

@dahacouk
Copy link
Member

Not sure about doing this. Please use the real name? If there isn't a real name then we'll need to look at our options. Usernames should never be used for display other than the URL (I think).

On 8 Jan 2015, at 14:14, andystiller notifications@github.com wrote:

Some users don't have a full name configured so for now I will make the code and the configuration use the username instead of the Full name.


Reply to this email directly or view it on GitHub:
#52 (comment)

@BBGuy
Copy link
Member Author

BBGuy commented Jan 14, 2015

@andystiller Can you make sure the real name is required, this will make sure all new users got one.
Can you also go over all existing users not many and make sure they all got a real name
and finally update all views, messages & email to use the real name

@andystiller
Copy link
Contributor

I have tested on my local copy and the Full Name field is required when registering a user either through the create new account screen or the /admin/people page.

@andystiller
Copy link
Contributor

I have tested on my local copy and the Full Name field is required when registering a user either through the create new account screen or the /admin/people page. I have updated the dev and live sites to make sure all users have a full name defined.

@andystiller
Copy link
Contributor

After a lot of thought and a discussion with @BBGuy I think that there should be change to messaging system. The current system has the owner of the message as the sender and a message recipient as a separate field. This makes sense for user messages but not for the system and entity message types.

The changes will allow for extra states of the message (eg. read, hidden) that can be changed by the recipient of the message.

If we make the owner of the message the recipient and only have an extra sender field for the user message that would make more sense and allow for the notification view to show all message types to the user.

Work required

  • All existing messages need to be deleted using the purge option.
  • The field_msg_recipient field needs to be deleted from user and system message types.
  • Add a new field_msg_sender field to the user message type.
  • There would be a small change to the code to account for the change
  • Update the views to filter on the message owner rather than the message recipient field.
  • Change the messaging rule to account for the change.

Use cases

User messages

Single recipient
The owner of the message is the recipient and the sender is stored in a new field, If the sender wants a copy of the message it would be system message to the sender with the name of the recipient and a copy of the user message body in the system message body.

Multiple recipients
The owner of the message is the recipient and the sender is stored in a new field, If the sender wants a copy of the message it would be system message to the sender with a list of recipients and a copy of the user message body in the system message body.

System Message

A system message would be sent from the site to a single recipient. The exact formatting of the message body would depend on the systems message being sent.

Entity Message

Claim request
For a claim request the owner of the message will be asset author and the sender can be derived from author of the claim request. The body of the request will include a link to the claim request along with any other information required,

andystiller added a commit that referenced this issue Jan 20, 2015
@andystiller
Copy link
Contributor

I have updated the code, views and rules to follow the changes outlined in the last comment.

I have also created and tested a new message type called an Entity Message. This type of message can be sent when an entity (e.g. an Asset or Claim Request) is created or changed. The Entity Message has an Entity reference field to Node.

@andystiller
Copy link
Contributor

Deploy to dev

  • Pull updated code from the dev branch
  • All existing messages need to be deleted using the purge option.
  • The field_msg_recipient field needs to be deleted from user and system message types.
  • Add a new field_msg_sender field to the user message type.
  • Import updated views
  • Import updated rules

Deploy to live

  • Merge dev banch into master
  • Pull updated code from the master branch
  • All existing messages need to be deleted using the purge option.
  • The field_msg_recipient field needs to be deleted from user and system message types.
  • Add a new field_msg_sender field to the user message type.
  • Import updated views
  • Import updated rules

@BBGuy BBGuy mentioned this issue Jan 20, 2015
19 tasks
@andystiller
Copy link
Contributor

The main work on the messaging system is now complete. The following issues continue the work on the messaging system and extend the functionality:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants