"""
Send emails with Google Mail account credentials.
"""

import yagmail

def send_email(to, subject, body, user, password):
    print("Send email to {}".format(to))

    EMAIL_FOOTER = """
    \n
    This is an automated message generated by Austin Transportation's Arterial Management Division. To unsubscribe, contact transportation.data@austintexas.gov.
    """

    body = body + EMAIL_FOOTER

    yag = yagmail.SMTP(user, password)
    yag.send(to=to, subject=subject, contents=body)