We currently are building functionality to allow sending emails from aRMT app on behalf of the study subject. The use case is that study subject are allowed to contact their assigned physician from within the app so that any problems or questions can be raised in a convenient manner.
This PR will implement a new POST endpoint /email/projects/<projectId>/users/<subjectId> endpoint. This endpoint receives a post body with structure:
The way how emails are sent is polymorphic. At present, the only method is by using the Firebase Trigger Email from Firestore extension. This method involves placing a JSON document in the Firebase database collection. The extension is configured to send emails from this database collection.
In the future, we can implement a way to directly send emails from Appserver. This would require to register SMTP server credentials in the service.
Remarks
At the moment I did not implement some for of rate limiting for sending email. Lets discuss whether we think this is needed.
In the current implementation, the aRMT app is responsible for defining all aspects of the email including the to, cc and bcc fields. In theory this would allow a subject to spam the whole world with emails. Lets discuss whether we need to change this.
We currently are building functionality to allow sending emails from aRMT app on behalf of the study subject. The use case is that study subject are allowed to contact their assigned physician from within the app so that any problems or questions can be raised in a convenient manner.
This PR will implement a new POST endpoint
/email/projects/<projectId>/users/<subjectId>
endpoint. This endpoint receives a post body with structure:In response the Appserver will send the email.
The way how emails are sent is polymorphic. At present, the only method is by using the Firebase Trigger Email from Firestore extension. This method involves placing a JSON document in the Firebase database collection. The extension is configured to send emails from this database collection.
In the future, we can implement a way to directly send emails from Appserver. This would require to register SMTP server credentials in the service.
Remarks
to
,cc
andbcc
fields. In theory this would allow a subject to spam the whole world with emails. Lets discuss whether we need to change this.