Пример #1
0
def main():
    """App controller."""
    provider = 'zonaprop'
    urls = [
        'casas-alquiler-maipu-con-pileta-menos-140000-pesos.html',
        'casas-alquiler-lujan-de-cuyo-con-pileta-menos-140000-pesos.html',
        'casas-alquiler-godoy-cruz-con-pileta-menos-140000-pesos.html',
        'casas-alquiler-chacras-de-coria-con-pileta-menos-140000-pesos.html',
        'casas-alquiler-carrodilla-con-pileta-menos-140000-pesos.html',
    ]
    houses_candidates = []

    for url in urls:
        candidates = fetch(url)
        houses_candidates = houses_candidates + candidates

    known_ids = common.get_known_ids(provider)

    houses = common.clean_candidates_id_list(houses_candidates, known_ids)

    print(houses)
    print(known_ids)

    # if new houses...
    if len(houses):
        email_subject = "Nuevas casas Zonaprop"
        email_body = json.dumps(houses)
        mailgun.send_simple_message(email_subject, email_body)
        for house in houses:
            common.add_new_id(house['id'], provider)
Пример #2
0
def sendmail(form_id):
	'''
	Function to send mail to entries under form based on label criteria
	'''
	mail_info = json.loads(request.data)
	mail = compose_mail(mail_info['to'], mail_info['subject'], mail_info['message'])
	mailgun.send_simple_message(mail)
	return ''
Пример #3
0
def sendmail(form_id):
    '''
	Function to send mail to entries under form based on label criteria
	'''
    mail_info = json.loads(request.data)
    mail = compose_mail(mail_info['to'], mail_info['subject'],
                        mail_info['message'])
    mailgun.send_simple_message(mail)
    return ''
Пример #4
0
def sendmail(to_list, bcc_list, subject, body):
	mail = {
		"from": "Procurement Spyder <*****@*****.**>",
		"to": to_list,
		"bcc": bcc_list,
		"subject": subject,
		"html": body
		}
	mailgun.send_simple_message(mail)
	return ''
Пример #5
0
def main():
    """App controller."""
    vehicles_candidates = fetch()

    last_id = common.get_last_id('losandes')

    vehicles, new_id = common.clean_candidates(vehicles_candidates, last_id)

    print(vehicles)
    print(last_id)

    # if new vehicles...
    if len(vehicles):
        email_subject = "Nuevas camionetas Los Andes"
        email_body = json.dumps(vehicles)
        mailgun.send_simple_message(email_subject, email_body)
        common.set_last_id(new_id, 'losandes')
Пример #6
0
def send_mail(message1, message2):
    # Usr mailgun to belt out an email!! Woot!
    data = {"from": "PingPongBot <*****@*****.**>",
                    "to": [message1['body']['Email'], message2['body']['Email']],
                    "subject": "Invitation to Ping Pong Tournament",
                    "text": "Starts Now!! --Preview Test-"}
    response = mailgun.send_simple_message(data)
    if response.status_code == 200:
        print "Invitation Sent!"
Пример #7
0
def main():
    """App controller."""
    provider = 'inmoclick'
    houses_candidates = fetch()

    known_ids = common.get_known_ids(provider)

    houses = common.clean_candidates_id_list(houses_candidates, known_ids)

    print(houses)
    print(known_ids)

    # if new houses...
    if len(houses):
        email_subject = "Nuevas casas Inmoclick"
        email_body = json.dumps(houses)
        mailgun.send_simple_message(email_subject, email_body)
        for house in houses:
            common.add_new_id(house['id'], provider)
Пример #8
0
def send_welcome_mail(mail_id, welcome_mail_info):
    mail = compose_mail([mail_id], welcome_mail_info['welcomeSubject'],
                        welcome_mail_info['welcomeMsg'])
    mailgun.send_simple_message(mail)
Пример #9
0
def send_welcome_mail(mail_id, welcome_mail_info):
	mail = compose_mail([mail_id], welcome_mail_info['welcomeSubject'], welcome_mail_info['welcomeMsg'])
	mailgun.send_simple_message(mail)