# Path: app/main.py



from flask import render_template
from flask_mail import Message
from app.main import app, mail
"""
Goal: implement helper class for sending emails

@authors:
  Andrei Sura             <sura.andrei@gmail.com>
  Ruchi Vivek Desai       <ruchivdesai@gmail.com>
  Sanath Pasumarthy       <sanath@ufl.edu>

@see: http://flask.pocoo.org/snippets/85/
"""



def send_email(subject, sender, recipients, text_body, html_body):
    """
    Helper for sending specific emails
    """
    msg = Message(subject, sender=sender, recipients=recipients)
    msg.body = text_body
    msg.html = html_body

    try:
        mail.send(msg)
    except Exception as exc:

# Path: app/main.py



# Path: app/emails.py
from flask import render_template
from flask_mail import Message
from app.main import app, mail

"""
Goal: implement helper class for sending emails

@authors:
  Andrei Sura             <sura.andrei@gmail.com>
  Ruchi Vivek Desai       <ruchivdesai@gmail.com>
  Sanath Pasumarthy       <sanath@ufl.edu>

@see: http://flask.pocoo.org/snippets/85/
"""



def send_email(subject, sender, recipients, text_body, html_body):
    """
    Helper for sending specific emails
    """
    msg = Message(subject, sender=sender, recipients=recipients)
    msg.body = text_body
    msg.html = html_body

    try:
        mail.send(msg)
    except Exception as exc:

        app.logger.debug("Error sending email [{}] to [{}] due: {}"