# Path: rhizi/rz_mail.py
# def send_email__flask_ctx(recipients, subject, body, attachments=[]):
#     """
#     Flask context dependent email sending utility
#     """
# 
#     send_from = current_app.rz_config.mail_default_sender
#     mta_host = current_app.rz_config.mta_host
#     mta_port = current_app.rz_config.mta_port
# 
#     send_email(mta_host,
#                         mta_port,
#                         send_from=send_from,
#                         recipients=recipients,
#                         subject=subject,
#                         attachments=attachments,
#                         body=body)
# 
#     log.info('email sent: recipients: %s: subject: %s, attachment-count: %d' % (recipients, subject, len(attachments)))
# 
# Path: rhizi/rz_req_handling.py
# def make_response__json(status=200, data={}):
#     """
#     Construct a json response with proper content-type header
# 
#     @param data: must be serializable via json.dumps
#     """
#     data_str = json.dumps(data)
#     resp = make_response(data_str)
#     resp.headers['Content-Type'] = "application/json"
#     resp.status = str(status)
# 
#     return resp
# 
# HTTP_STATUS__500_INTERNAL_SERVER_ERROR = 500


import base64
import logging
from flask import current_app
from flask import json
from flask import request
from flask import session
from .rz_mail import send_email__flask_ctx
from .rz_req_handling import make_response__json, HTTP_STATUS__500_INTERNAL_SERVER_ERROR
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.





log = logging.getLogger('rhizi')

class RZ_User_Feedback(object):
    def __init__(self, url=None,
                       note=None,
                       img=None,
                       html=None,
                       user_agent=None):

        self.url = url,
        self.note = note
        self.img = img
        self.html = html

# Path: rhizi/rz_mail.py
# def send_email__flask_ctx(recipients, subject, body, attachments=[]):
#     """
#     Flask context dependent email sending utility
#     """
# 
#     send_from = current_app.rz_config.mail_default_sender
#     mta_host = current_app.rz_config.mta_host
#     mta_port = current_app.rz_config.mta_port
# 
#     send_email(mta_host,
#                         mta_port,
#                         send_from=send_from,
#                         recipients=recipients,
#                         subject=subject,
#                         attachments=attachments,
#                         body=body)
# 
#     log.info('email sent: recipients: %s: subject: %s, attachment-count: %d' % (recipients, subject, len(attachments)))
# 
# Path: rhizi/rz_req_handling.py
# def make_response__json(status=200, data={}):
#     """
#     Construct a json response with proper content-type header
# 
#     @param data: must be serializable via json.dumps
#     """
#     data_str = json.dumps(data)
#     resp = make_response(data_str)
#     resp.headers['Content-Type'] = "application/json"
#     resp.status = str(status)
# 
#     return resp
# 
# HTTP_STATUS__500_INTERNAL_SERVER_ERROR = 500


# Path: rhizi/rz_feedback.py
import base64
import logging
from flask import current_app
from flask import json
from flask import request
from flask import session
from .rz_mail import send_email__flask_ctx
from .rz_req_handling import make_response__json, HTTP_STATUS__500_INTERNAL_SERVER_ERROR

#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.





log = logging.getLogger('rhizi')

class RZ_User_Feedback(object):
    def __init__(self, url=None,
                       note=None,
                       img=None,
                       html=None,
                       user_agent=None):

        self.url = url,
        self.note = note
        self.img = img
        self.html = html

        self.user_agent = user_agent