diff --git a/tailbone/api/common.py b/tailbone/api/common.py index c2823ff9..81458c01 100644 --- a/tailbone/api/common.py +++ b/tailbone/api/common.py @@ -104,7 +104,8 @@ class CommonView(APIView): data['user_url'] = '#' # TODO: could get from config? data['client_ip'] = self.request.client_addr - send_email(self.rattail_config, self.feedback_email_key, data=data) + email_key = data['email_key'] or self.feedback_email_key + send_email(self.rattail_config, email_key, data=data) return {'ok': True} return {'error': "Form did not validate!"} diff --git a/tailbone/forms/common.py b/tailbone/forms/common.py index 9cc145dd..26934479 100644 --- a/tailbone/forms/common.py +++ b/tailbone/forms/common.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2021 Lance Edgar # # This file is part of Rattail. # @@ -46,6 +46,9 @@ class Feedback(colander.Schema): """ Form schema for user feedback. """ + email_key = colander.SchemaNode(colander.String(), + missing=colander.null) + referrer = colander.SchemaNode(colander.String()) user = colander.SchemaNode(colander.String(),