Пример #1
0
def oups(request):
    from project.rent.models import MemberRentalPlan
    ctx = {
        'CATALOG_CATEGORIES': Category.list_names(),
        'SITE_URL': 'http://%s' % Site.objects.get_current().domain,
        'STATIC_URL': settings.STATIC_URL,
    }

#    plan = MemberRentalPlan.get_current_plan(request.user)
    plan = MemberRentalPlan.objects.all()[0]

    from project.utils.mailer import mail
    mail('*****@*****.**', 'emails/rent_emails/plan_subscription_successfull.html', {
        'user': plan.user,
        'plan': plan,
        'new_releases': Item.list_new_releases(6),
        'coming_soon': Item.list_all()[:6],
    }, subject="TEST EMAIL!")

    return render_to_response('emails/rent_emails/plan_subscription_successfull.html', {
        'user': plan.user,
        'plan': plan,
        'new_releases': Item.list_new_releases(6),
        'coming_soon': Item.list_all()[:6],
    }, Context(ctx))
Пример #2
0
def send_billing_charge_approved(user_or_profile, amount):
        profile = get_profile(user_or_profile)
        mail(profile.email, 'billing/emails/billing_charge_approved.html', {
            'plan': profile.member_rental_plan,
            'user': profile.user,
            'cc_type': profile.billing_card.get_type_display(),
            'cc_num': profile.billing_card.data['number'][-4:],
            'amount': amount,
        }, subject='Gamemine - Billing Charge Approved')
Пример #3
0
 def do_send_empty_list_nofitications(self):
     debug('Sending "empty" rent list notifications...')
     qs = MemberRentalPlan.objects.filter(status=RentalPlanStatus.Active)
     for member_plan in qs:
         if RentList.get(member_plan.user).count() < 10:
             user = member_plan.user
             debug("  Send to %s...", user.email)
             mail(user.email, "emails/rent_emails/add_more_games.html", {
                 "user": user,
             }, subject="Your Rent List is Low! - Add More Games")
Пример #4
0
 def send_email_confirmation_mail(self):
     self.activation_code = str(uuid4())
     self.save()
     url = 'http://%s%s' % (
         Site.objects.get_current().domain,
         reverse('members:confirm_registration', args=[self.activation_code]))
     terms_url = 'http://%s%s' % (
         Site.objects.get_current().domain,
         reverse('simple-page', args=['Terms']))
     mail(self.user.email, 'emails/account_emails/email_confirmation.html', {
         'user': self.user,
         'email': self.user.email,
         'url': url,
         'terms_url': terms_url,
     }, subject='Gamemine - Please Confirm your Email Address')
Пример #5
0
def subscribe(request):
    class SubscriptionForm(forms.Form):
        email = forms.EmailField()
    form = SubscriptionForm(request.GET)
    if form.is_valid():
        subscriber = Subscriber()
        subscriber.email = form.cleaned_data['email']
        subscriber.campaign_cid = request.campaign_id
        subscriber.save()
        
        ctx = {
            'email': subscriber.email,
            'guid': subscriber.guid,
            'confirmation_url': 'http://%s%s' % (
                Site.objects.get_current().domain,
                reverse('subscription:confirm', kwargs={'guid': subscriber.guid}),
            ), 
        }
        mail(subscriber.email, 'subscription/confirmation_email.html', ctx, subject='GameMine. E-mail confirmation')

        return JsonResponse({'success': True})
    return JsonResponse({'success': False})
Пример #6
0
 def send_membership_suspension_mail(self):
     mail(self.user.email, 'emails/account_emails/membership_suspension.html', {
         'user': self.user,
     }, subject='Your Gamemine Account')
Пример #7
0
 def send_edit_account_information_mail(self, changed_info):
     mail(self.user.email, 'emails/account_emails/edit_account_information.html', {
         'user': self.user,
         'changed_info': changed_info,
     }, subject='Gamemine - Account Update Confirmation')
Пример #8
0
 def send_email(self):
     mail(self.mailed_to, 'emails/crm/reply.html', {
         'reply': self,
     }, subject='Gamemine - Reply')
Пример #9
0
 def send_order_expired(self):
     mail(self.user.email, 'emails/trade_emails/order_expired.html', {
         'order': self,
         'user': self.user,
         'items': self.groupped_items(),
     }, subject='Gamemine Trade-In #' + self.order_no() + ' Has Expired')
Пример #10
0
 def send_order_processed(self):
     mail(self.user.email, 'emails/trade_emails/order_processed.html', {
         'order': self,
         'user': self.user,
     }, subject='Gamemine Trade-In Order #' + self.order_no() + ' Processed')
Пример #11
0
 def send_order_confirmation(self):
     mail(self.user.email, 'emails/trade_emails/order_confirmation.html', {
         'order': self,
         'user': self.user,
     }, subject='Gamemine Trade-In - Confirmation #' + self.order_no())
Пример #12
0
 def send_address_hold_restriction_email(self):
     mail(self.order.user.email, 'emails/buy_emails/address_hold_restriction_email.html', {
         'order': self,
         'user': self.order.user,
     }, subject='Account Restricted - Confirm your Mailing Address')
Пример #13
0
 def send_order_shipped_email(self):
     mail(self.order.user.email, 'emails/buy_emails/order_shipped_email.html', {
         'order': self,
         'user': self.order.user,
         'nickname': self.order.user.username,
     }, subject='Gamemine - Order Shipped')
Пример #14
0
 def send_order_creation_confirmation_email(self):
     mail(self.user.email, 'emails/buy_emails/order_creation_confirmation_email.html', {
         'user': self.user,
     }, subject='Gamemine - Your Receipt #%s' % self.get_order_number())
Пример #15
0
 def send_email(self):
     mail(self.user.email, 'emails/claims/rent_lost_game.html', {
         'claim': self,
         'user': self.user,
     }, subject='Your "Lost Game" problem has been received')