| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | Certain actions on the website trigger events that are handed to a RabbitMQ queueing server. These events and their contents are described here. |
| | 4 | |
| | 5 | ### Delivery mode ### |
| | 6 | All events that are sent to the queue MUST be sent with '''delivery_mode = 2''' (persistent messages). |
| | 7 | |
| | 8 | ### Exchange name ### |
| | 9 | All events are sent to the exchange '''extensionschoolevents''' |
| | 10 | |
| | 11 | ### Mail events ### |
| | 12 | |
| | 13 | Mail is sent through the queue server in order to accomplish asynchronous mail sending (keep the webserver from blocking). |
| | 14 | |
| | 15 | A mail event is identified by the routing key '''mail.sending''' |
| | 16 | |
| | 17 | The body of a mail event consists of a JSON-encoded dictionary of the following form: |
| | 18 | |
| | 19 | {{{#!python |
| | 20 | |
| | 21 | { |
| | 22 | 'from_email': 'sender@my.domain', |
| | 23 | 'recipient_list': [ 'recipient1@gmail.com', 'recipient2@hotmail.com' ], |
| | 24 | 'subject': 'The subject line for this message', |
| | 25 | 'message': 'A multi-line string holding the text version of this message', |
| | 26 | 'html_message': 'A multi-line string holding the html-version of this message', |
| | 27 | } |
| | 28 | }}} |
| | 29 | |
| | 30 | The '''html_message''' field is optional. |