# Path: nflpool/email/template_parser.py
# class EmailTemplateParser:
#     welcome = None
#     reset_password = None
# 
#     @staticmethod
#     def global_init():
#         templates = os.path.join(os.path.dirname(__file__), "templates")
#         welcome_file = os.path.join(templates, "welcome.html")
#         with open(welcome_file) as fin:
#             EmailTemplateParser.welcome = fin.read()
# 
#         welcome_file = os.path.join(templates, "password_reset.html")
#         with open(welcome_file) as fin:
#             EmailTemplateParser.reset_password = fin.read()
# 
#     @staticmethod
#     def expand(template, data):
# 
#         final_text = template
#         for k in data:
#             key = "{" + k + "}"
#             final_text = final_text.replace(key, data[k])
# 
#         return final_text


import mailer
import html2text
from nflpool.email.template_parser import EmailTemplateParser



class EmailService:
    __smtp_username = None
    __smtp_password = None
    __smtp_server = None
    __smtp_port = None
    __is_debug_mode = False
    __from_address = "NFLPool <pcutler@nflpool.xyz>"

    @staticmethod
    def global_init(username, password, server, port, is_debug):
        EmailService.__is_debug_mode = is_debug
        EmailService.__smtp_username = username
        EmailService.__smtp_password = password
        EmailService.__smtp_port = int(port)
        EmailService.__smtp_server = server

    @staticmethod

# Path: nflpool/email/template_parser.py
# class EmailTemplateParser:
#     welcome = None
#     reset_password = None
# 
#     @staticmethod
#     def global_init():
#         templates = os.path.join(os.path.dirname(__file__), "templates")
#         welcome_file = os.path.join(templates, "welcome.html")
#         with open(welcome_file) as fin:
#             EmailTemplateParser.welcome = fin.read()
# 
#         welcome_file = os.path.join(templates, "password_reset.html")
#         with open(welcome_file) as fin:
#             EmailTemplateParser.reset_password = fin.read()
# 
#     @staticmethod
#     def expand(template, data):
# 
#         final_text = template
#         for k in data:
#             key = "{" + k + "}"
#             final_text = final_text.replace(key, data[k])
# 
#         return final_text


# Path: nflpool/services/email_service.py
import mailer
import html2text
from nflpool.email.template_parser import EmailTemplateParser




class EmailService:
    __smtp_username = None
    __smtp_password = None
    __smtp_server = None
    __smtp_port = None
    __is_debug_mode = False
    __from_address = "NFLPool <pcutler@nflpool.xyz>"

    @staticmethod
    def global_init(username, password, server, port, is_debug):
        EmailService.__is_debug_mode = is_debug
        EmailService.__smtp_username = username
        EmailService.__smtp_password = password
        EmailService.__smtp_port = int(port)
        EmailService.__smtp_server = server

    @staticmethod

    def send_email(to_address, subject, html_body):