Esempio n. 1
0
def bulk_facebook_send(template, file):
    conn = boto.connect_sqs(env.aws_access_key, env.aws_secret_key)
    q = conn.create_queue('seamail')
    q.set_message_class(_JSONMessage)

    for line in open(file, 'r'):
        id, email, name, first_name, last_name, gender, locale = line.split(',')
        args = {'first_name': first_name, 'last_name': last_name, 
                'gender': gender}
        q.write(_JSONMessage(body=[template, name, email, args, 0]))
Esempio n. 2
0
def send_message(template, name, email, **kwargs):
    conn = boto.connect_sqs(env.aws_access_key, env.aws_secret_key)
    q = conn.create_queue('seamail')
    q.set_message_class(_JSONMessage)
    q.write(_JSONMessage(body=[template, name, email, kwargs, 0]))