@@ -194,6 +194,68 @@ To build the documentation, run:
...
@@ -194,6 +194,68 @@ To build the documentation, run:
After this, generated documentation should be available in `docs/_build/html`.
After this, generated documentation should be available in `docs/_build/html`.
## Mails
The `mails` app shall be used as the mailing processor of SciPost. It may be used in either one of two possible ways: with or without editor.
The actual mails only have to be written in the html version, the text based alternative is automatically generated before sending. Creating a new `mail_code` is easily done by creating new files in the `mails/templates/mail_templates` folder called `<mail_code>.html` and `<mail_code>.json` acting as resp. a content and configuration file.
##### The config file is configured as follows
`mails/templates/mail_templates/<mail_code>.json`
*`context_object` - (_required_) Instance of the main object. This instance needs to be passed as `instance` or `<context_object>` in the views and as `<context_object>` in the template file (see description below);
Any regular method or class based view may be used together with the builtin wysiwyg editor. The class based views inherited from Django's UpdateView are easily extended for use with the editor.
```python
fromdjango.views.generic.editimportUpdateView
frommails.mixinsimportMailEditorMixin
classAnyUpdateView(MailEditorMixin,UpdateView):
mail_code='<any_valid_mail_code>'
```
For method based views, one implements the mails construction as: