示例#1
0
def confirmation_email(email, **kwargs):
    try:
        letter = Letter()
        letter.sender = '*****@*****.**'
        letter.sender_name = 'Yottos GetMyAd'
        letter.recipients = email
        letter.subject = u'Подтверждение заявки на вывод средств в Yottos GetMyAd'
        letter.template = '/users/money_out/confirmation.mako.txt'
        letter.set_message(**kwargs)
        letter.send('yottos.com', 26, '*****@*****.**', '57fd8824')
    except Exception as ex:
        print "sendmail failed to %s: %s (retry #%s)" % (email, ex, kwargs.get('task_retries',0))
        confirmation_email.retry(args=[email], kwargs=kwargs, exc=ex)
    else:
        print "sendmail to %s ok" % email
示例#2
0
def registration_request_user(email, **kwargs):
    try:
        letter = Letter()
        letter.sender = '*****@*****.**'
        letter.sender_name = 'Yottos GetMyAd'
        letter.recipients = email
        letter.subject = u'Рекламная сеть Yottos - заявка на участие сайта %s' % kwargs['site_url']
        letter.template = 'users/registration_request.mako.txt'
        letter.set_message(**kwargs)
        letter.send('yottos.com', 26, '*****@*****.**', '57fd8824')
    except Exception as ex:
        print "sendmail failed to %s: %s (retry #%s)" % (email, ex, kwargs.get('task_retries',0))
        registration_request_user.retry(args=[email], kwargs=kwargs, exc=ex)
    else:
        print "sendmail to %s ok" % email
示例#3
0
def registration_request_manager(**kwargs):
    email = '*****@*****.**'
    try:
        letter = Letter()
        letter.sender = '*****@*****.**'
        letter.sender_name = 'Yottos GetMyAd'
        letter.recipients = email
        letter.subject = u'Заявка на регистрацию в GetMyAd'
        letter.template = 'managers/registration_request.mako.txt'
        letter.set_message(**kwargs)
        letter.send('yottos.com', 26, '*****@*****.**', '57fd8824')
    except Exception as ex:
        print "sendmail failed to %s: %s (retry #%s)" % (email, ex, kwargs.get('task_retries',0))
        registration_request_manager.retry(args=[], kwargs=kwargs, exc=ex)
    else:
        print "sendmail to %s ok" % email
示例#4
0
def money_out_request(payment_type, email, **kwargs):
    try:
        letter = Letter()
        letter.sender = '*****@*****.**'
        letter.sender_name = 'Yottos GetMyAd'
        letter.recipients = email
        letter.subject = u'Вывод средств Yottos GetMyAd'
        if payment_type == 'webmoney_z':
            letter.template = 'users/money_out/webmoney.mako.txt'
        elif payment_type == 'card':
            letter.template = 'users/money_out/card.mako.txt'
        elif payment_type == 'factura':
            letter.template = 'users/money_out/invoice.mako.txt'
        elif payment_type == 'yandex':
            letter.template = 'users/money_out/yandex.mako.txt'

        letter.set_message(**kwargs)
        letter.send('yottos.com', 26, '*****@*****.**', '57fd8824')
    except Exception as ex:
        print "sendmail failed to %s: %s (retry #%s)" % (email, ex, kwargs.get('task_retries',0))
        money_out_request.retry(args=[payment_type, email], kwargs=kwargs, exc=ex)
    else:
        print "sendmail to %s ok" % email