コード例 #1
0
def email_password_reset_new_token(user_id):
    try:
        user = User.objects.get(pk=user_id)

        ctx_dict = utils.get_email_context(user)

        ctx_dict.update({
            'uid': int_to_base36(user.id),
            'token': default_token_generator.make_token(user),
        })

        print ctx_dict

        subject = utils.get_email_subject(
            'registration/password_reset_email_subject.txt', ctx_dict)

        text_content = utils.get_email_text_content(
            'registration/password_reset_email.txt', ctx_dict)

        utils.send_mail('registration/password_reset_email.html',
                        ctx_dict,
                        subject,
                        text_content,
                        settings.DEFAULT_FROM_EMAIL, [
                            user.email,
                        ],
                        user=user)
    except Exception, exc:
        raise email_password_reset_new_token.retry(exc=exc)
コード例 #2
0
ファイル: automatic_emails.py プロジェクト: kmdg/skyhigh
def email_product_evaluation_started(user_id):
    user = User.objects.get(pk=user_id)

    ctx_dict = utils.get_email_context(user)

    subject = utils.get_email_subject('skyhigh/email/subjects/product_evaluation_started_subject.txt', ctx_dict)

    text_content = utils.get_email_text_content('skyhigh/email/txt/product_evaluation_started.txt', ctx_dict)
コード例 #3
0
def email_product_evaluation_started(user_id):
    user = User.objects.get(pk=user_id)

    ctx_dict = utils.get_email_context(user)

    subject = utils.get_email_subject(
        'skyhigh/email/subjects/product_evaluation_started_subject.txt',
        ctx_dict)

    text_content = utils.get_email_text_content(
        'skyhigh/email/txt/product_evaluation_started.txt', ctx_dict)
コード例 #4
0
ファイル: automatic_emails.py プロジェクト: kmdg/skyhigh
def email_order_processed_channel_partner(user_id):
    user = User.objects.get(pk=user_id)

    ctx_dict = utils.get_email_context(user)

    subject = utils.get_email_subject('skyhigh/email/subjects/order_processed_channel_partner_subject.txt', ctx_dict)

    text_content = utils.get_email_text_content('skyhigh/email/txt/order_processed_channel_partner.txt', ctx_dict)

    utils.send_mail('skyhigh/email/html/order_processed_channel_partner.html', ctx_dict, subject,
        text_content, settings.DEFAULT_FROM_EMAIL, [user.email,], user=user)
コード例 #5
0
ファイル: automatic_emails.py プロジェクト: kmdg/skyhigh
def email_product_evaluation_expired():
    from skyhigh import models

    for product_evaluation in models.ProductEvaluation.objects.filter(status=constants.PRODUCT_EVALUATION_STATUS_APPROVED,
                                                                        modified__lte=timezone.now()-timezone.timedelta(days=30),
                                                                        expired_email_sent=False):

        user = product_evaluation.user

        ctx_dict = utils.get_email_context(user)

        subject = utils.get_email_subject('skyhigh/email/subjects/product_evaluation_expired_subject.txt', ctx_dict)

        text_content = utils.get_email_text_content('skyhigh/email/txt/product_evaluation_expired.txt', ctx_dict)
コード例 #6
0
ファイル: automatic_emails.py プロジェクト: kmdg/skyhigh
def email_support_request(user_id):
    try:
        user = User.objects.get(pk=user_id)
    
        ctx_dict = utils.get_email_context(user)
    
        subject = utils.get_email_subject('skyhigh/email/subjects/support_request_subject.txt', ctx_dict)
    
        text_content = utils.get_email_text_content('skyhigh/email/txt/support_request.txt', ctx_dict)
    
        utils.send_mail('skyhigh/email/html/support_request.html', ctx_dict, subject,
            text_content, settings.DEFAULT_FROM_EMAIL, [user.email,], user=user)
    except Exception, exc:
        raise email_support_request.retry(exc=exc)
コード例 #7
0
def email_product_evaluation_expired():
    from skyhigh import models

    for product_evaluation in models.ProductEvaluation.objects.filter(
            status=constants.PRODUCT_EVALUATION_STATUS_APPROVED,
            modified__lte=timezone.now() - timezone.timedelta(days=30),
            expired_email_sent=False):

        user = product_evaluation.user

        ctx_dict = utils.get_email_context(user)

        subject = utils.get_email_subject(
            'skyhigh/email/subjects/product_evaluation_expired_subject.txt',
            ctx_dict)

        text_content = utils.get_email_text_content(
            'skyhigh/email/txt/product_evaluation_expired.txt', ctx_dict)
コード例 #8
0
def email_order_processed_channel_partner(user_id):
    user = User.objects.get(pk=user_id)

    ctx_dict = utils.get_email_context(user)

    subject = utils.get_email_subject(
        'skyhigh/email/subjects/order_processed_channel_partner_subject.txt',
        ctx_dict)

    text_content = utils.get_email_text_content(
        'skyhigh/email/txt/order_processed_channel_partner.txt', ctx_dict)

    utils.send_mail('skyhigh/email/html/order_processed_channel_partner.html',
                    ctx_dict,
                    subject,
                    text_content,
                    settings.DEFAULT_FROM_EMAIL, [
                        user.email,
                    ],
                    user=user)
コード例 #9
0
ファイル: automatic_emails.py プロジェクト: kmdg/skyhigh
def email_password_reset_new_token(user_id):
    try:
        user = User.objects.get(pk=user_id)
    
        ctx_dict = utils.get_email_context(user)
    
        ctx_dict.update({'uid': int_to_base36(user.id),
                         'token': default_token_generator.make_token(user),
                        })
        
        print ctx_dict
    
        subject = utils.get_email_subject('registration/password_reset_email_subject.txt', ctx_dict)
    
        text_content = utils.get_email_text_content('registration/password_reset_email.txt', ctx_dict)
    
        utils.send_mail('registration/password_reset_email.html', ctx_dict, subject,
            text_content, settings.DEFAULT_FROM_EMAIL, [user.email,], user=user)
    except Exception, exc:
        raise email_password_reset_new_token.retry(exc=exc)
コード例 #10
0
def email_support_request(user_id):
    try:
        user = User.objects.get(pk=user_id)

        ctx_dict = utils.get_email_context(user)

        subject = utils.get_email_subject(
            'skyhigh/email/subjects/support_request_subject.txt', ctx_dict)

        text_content = utils.get_email_text_content(
            'skyhigh/email/txt/support_request.txt', ctx_dict)

        utils.send_mail('skyhigh/email/html/support_request.html',
                        ctx_dict,
                        subject,
                        text_content,
                        settings.DEFAULT_FROM_EMAIL, [
                            user.email,
                        ],
                        user=user)
    except Exception, exc:
        raise email_support_request.retry(exc=exc)