#Messaging
For communication towards the users a custom component will be used which sends e-mails and places the message in the database through a model. The messaging will become part of the users plug-in.
##Personal messaging
Personal messages are defined as user to user messages. These messages can be sent by every registered user which isn't marked as a spammer.
It will be possible to disable e-mail forwarding for these messages by unchecking the "Forward user messages to my e-mail." option in the user's profile, however moderator messages will ignore this setting and still be delivered by e-mail to the recipient.
The messages are stored in the database and can be viewed at the Bakery. The messages are listed as conversations where both users will have access to. First there will be the message and underneath the replies will be listed similar to a message board.
In the message notification e-mail will be a quote of the message along with a direct link to the message.
##System messaging
Messaging from within the application will go through the users plug-in as well. The user shall have an option "Forward system messages to my e-mail." in his personal profile settings to receive e-mail notifications from the Bakery by e-mail. This will be checked by default.
The following cases could be system messages for which e-mail forwarding can be deactivated:
- Article approval/denial notifications.
- Comment notifications.
The following cases will be system messages which are always forwarded to the user's e-mail address:
- E-mail activation mail.
- Lost password mail.
A user can not reply to system messages.
##Sanitizing messages
Messages that are submitted by users should be sanized before passed into the Messaging Component. This is not built in because of the compatibility with HTML messages. An example can be found in the add() action at APP/plugins/users/controllers/messages_controller.php of the usersplugin branch.
