Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-919

Allow customization of notification messages sent to users




      The backend code sends various messages to users. Examples:

      • Email when reservation is ready
      • Email when image capture is complete or delayed
      • Terminal notification when a Linux reservation is about to timeout

      All of the messages are hard-coded in the backend code. It would be an improvement to allow these messages to be customized without having to alter the source code.

      Proposed solution:
      A database table named usermessage would be added to the schema. It would, at a minimum, contain:

      • id
      • key
      • affiliationid
      • deliverymethod
      • subject
      • message

      The id field is not absolutely necessary but keeps with the structure of most other tables in the schema.

      The key field would be a unique identifier string which is more convenient to use than a simple integer. For example, reservationready could correspond to the message sent to a user when the Connect button appears. The backend code could call something like

      my ($subject, $message) = get_user_message('reservationready', $user_affiliation_id);

      The affiliationid field allows messages to be customized for different sets of users. The messages currently hard coded would be added to the schema using the global affiliation. Users would be sent these by default unless a message exists specific to their affiliation.

      The deliverymethod field would be used to allow email messages, IM messages, and other types of messages to use different text. There would be situations where you'd want to send the same message but some methods may have constraints. This could also facilitate a mobile text message feature in the future. The backend code could specify which type of message to retrieve:

      my ($subject, $message) = get_user_message('reservationready', $user_affiliation_id, 'sms');

      The backend code and database are fairly straightforward to implement. A web frontend feature would need to be added to allow system administrators to modify the messages.

      There needs to be a mechanism to specify variables in the subject and message fields so the backend can dynamically generate the message with the correct IP address, image name, etc. The syntax and vocabulary need to be determined so the backend and frontend are aligned.




            Unassigned Unassigned
            arkurth Andrew Kurth
            0 Vote for this issue
            3 Start watching this issue