Create mechanism to send email
See parent ticket #34 (closed)
Replaces #121 (closed)
We need to send emails in a number of scenarios:
- At certain steps the system should automatically send pre-formatted messages
- At other steps users (admin, others) have the option to write arbitrary text and send emails to others
- Some of these messages will be sent to people who are not (yet) users in the system
Some facts:
- We do not want to send email addresses over HTTP.
- In the shared data model, email addresses should be retrieveable either under user or under user.alias (for people who are not in the system).
- Users will be associated with manuscripts by team and role.
We need a system that is able to retrieve email addresses and notes from the database and send the appropriate email (either pre-templated or written by a user and saved in manuscript.notes) after being sent something like:
- The manuscript id
- The sender user id / role
- The recipient user id / role
- The type of message
- Where to find the text of message (under manuscript.notes, using notes type?)
Please check the component recently built at https://gitlab.coko.foundation/pubsweet/pubsweet/tree/component-email-templating/packages/components/EmailTemplating-server (See merge request and comments at pubsweet/pubsweet!413 (merged)) Can we use this as-is? Modify it and use it to meet our needs (instead of starting from scratch)?
Edited by Audrey Hamelers