# Path: sheetsite/site_queue.py



from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from sheetsite.site_queue import app
import json
import os
import smtplib
    import daff
    import jinja2
    import premailer


@app.task
def notify_one(email, subject, page, text):

    print("send [%s] / %s / %s" % (email, subject, page))

    server_ssl = smtplib.SMTP_SSL("smtp.gmail.com", 465)
    server_ssl.ehlo()  # optional, called by login()
    me = os.environ['GMAIL_USERNAME']
    server_ssl.login(me, os.environ['GMAIL_PASSWORD'])

    msg = MIMEMultipart('alternative')
    msg['Subject'] = subject
    msg['From'] = me
    msg['To'] = email

    # Record the MIME types of both parts - text/plain and text/html.
    part1 = MIMEText(text, 'plain')
    part2 = MIMEText(page, 'html')

    msg.attach(part1)
    msg.attach(part2)

    server_ssl.sendmail(me, email, msg.as_string())
    server_ssl.close()

    return True



# Path: sheetsite/site_queue.py



# Path: sheetsite/tasks/notify.py
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from sheetsite.site_queue import app
import json
import os
import smtplib
    import daff
    import jinja2
    import premailer



@app.task
def notify_one(email, subject, page, text):

    print("send [%s] / %s / %s" % (email, subject, page))

    server_ssl = smtplib.SMTP_SSL("smtp.gmail.com", 465)
    server_ssl.ehlo()  # optional, called by login()
    me = os.environ['GMAIL_USERNAME']
    server_ssl.login(me, os.environ['GMAIL_PASSWORD'])

    msg = MIMEMultipart('alternative')
    msg['Subject'] = subject
    msg['From'] = me
    msg['To'] = email

    # Record the MIME types of both parts - text/plain and text/html.
    part1 = MIMEText(text, 'plain')
    part2 = MIMEText(page, 'html')

    msg.attach(part1)
    msg.attach(part2)

    server_ssl.sendmail(me, email, msg.as_string())
    server_ssl.close()

    return True



@app.task