TheSerapher/php-mpos — pull request #1026 by headzoo (2013-12-19 03:28:45+00:00)
Title: Site Messaging System

This patch adds a simple internal site messaging system. An "Inbox".

Purpose
======
* System administrators may wish to communicate with their users without exposing an email address.
* Users may like receiving notices directly on the site instead of having their email inboxes spammed.
* Good for communication when site emails commonly end up in spam folders.
* Increases the site return rate by giving users a reason to continuously come back to the site.
* It's neat!

Additions
=======
Here is a list of site features which have been changed or added.

Sidebar
-----------
The sidebar now has an Inbox link, with an indication of the number of unread messages.

![sidebar](https://f.cloud.github.com/assets/707209/1779823/0e375ae6-6859-11e3-8b80-06b834b50dc7.png)

The Inbox
-------------
The inbox is very simple. It's not designed to hold lengthy conversations with users.

![messages](https://f.cloud.github.com/assets/707209/1779833/68d4a06c-6859-11e3-9062-4605b062ea5b.png)

Replying
------------
Replying to messages is quick and simple.

![replying](https://f.cloud.github.com/assets/707209/1779867/fa553e20-6859-11e3-8f86-0babeb9dffe6.png)

Admin Settings
----------------------
Two new admin settings. The inbox feature may be disabled completely, and admins may choose to receive contact form submissions to their inbox instead of real email.
![settings](https://f.cloud.github.com/assets/707209/1779837/7e1765cc-6859-11e3-8241-351c1a516fc5.png)

User Settings
-------------------
The users also get a new setting to receive notices to their inbox instead of real email.
![user_settings](https://f.cloud.github.com/assets/707209/1779848/c2601b3e-6859-11e3-80bf-3301373c08d1.png)

Contact Form
--------------------
The contact form does not ask for name or email when admins have enabled the inbox feature, and want to have contact form submissions sent to their inbox.
![contactform](https://f.cloud.github.com/assets/707209/1779865/e31b2a62-6859-11e3-977e-a02bf81d2c65.png)

Sending Messages to Users
-----------------------------------------
Usernames on the user information page are links. When clicked the admin can send a message to the user, which is received in their inbox.
![users](https://f.cloud.github.com/assets/707209/1779871/0e9a2c2e-685a-11e3-8802-3e812bd99fcf.png)

Notes
====
Currently the inbox system only allows admins to send messages to users, and the users may reply. It does not allow user to user messages, but that can be added by changing only a few lines of code.

Adds the database table `inbox`, where the messages are saved. The SQL has been added to the 000_base_structure.sql file.

The Fontello icon set has been updated to add the inbox icon.

New email templates were added using markdown instead of HTML, for users who have notices sent to their inbox.

I tried to copy the coding style and structure of the existing project, but there may be a few gaps here and there.