From 4a35620820617719f82ebfd3e6c4c0b4d28db987 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 10 Feb 2020 12:35:30 -0600 Subject: [PATCH] Allow override of "email key" for user feedback, sent via API --- tailbone/api/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tailbone/api/common.py b/tailbone/api/common.py index dd74fe6f..e8e297f3 100644 --- a/tailbone/api/common.py +++ b/tailbone/api/common.py @@ -41,7 +41,13 @@ from tailbone.db import Session class CommonView(APIView): """ Misc. "common" views for the API. + + .. attribute:: feedback_email_key + + This is the email key which will be used when sending "user feedback" + email. Default value is ``'user_feedback'``. """ + feedback_email_key = 'user_feedback' @api def about(self): @@ -94,7 +100,7 @@ class CommonView(APIView): data['user_url'] = '#' # TODO: could get from config? data['client_ip'] = self.request.client_addr - send_email(self.rattail_config, 'user_feedback', data=data) + send_email(self.rattail_config, self.feedback_email_key, data=data) return {'ok': True} return {'error': "Form did not validate!"}