• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.send_template_mail函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nnmware.core.utils.send_template_mail函数的典型用法代码示例。如果您正苦于以下问题:Python send_template_mail函数的具体用法?Python send_template_mail怎么用?Python send_template_mail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了send_template_mail函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: booking_new_sysadm_mail

def booking_new_sysadm_mail(booking):
    recipients = settings.BOOKING_MANAGERS
    mail_dict = {'booking': booking,
                 'site_name': settings.SITENAME}
    subject = 'booking/on_create_to_sysadm_subject.txt'
    body = 'booking/on_create_to_sysadm.txt'
    send_template_mail(subject, body, mail_dict, recipients)
开发者ID:biomassives,项目名称:nnmware,代码行数:7,代码来源:utils.py


示例2: handle

 def handle(self, *args, **options):
     activate('ru')
     for hotel in Hotel.objects.exclude(admins=None).exclude(work_on_request=True):
         result = []
         all_users = []
         for room in hotel.room_set.all():
             avail = Availability.objects.filter(room=room, date__range=(
                 now(), now() + timedelta(days=13))).count()
             if avail < 14:
                 avail_err = [room.get_name, _('Not filled availability')]
                 result.append(avail_err)
             for settlement in SettlementVariant.objects.filter(room=room, enabled=True):
                 if settlement.current_amount() is 0:
                     settlement_err = [room.get_name,
                                       _('Not filled price for %s-placed settlement') % settlement.settlement]
                     result.append(settlement_err)
         if len(result) > 0:
             if len(hotel.email) > 0:
                 all_users.append(hotel.email)
             if len(hotel.contact_email) > 0:
                 all_users.append(hotel.contact_email)
             recipients = all_users  # settings.BOOKING_MANAGERS
             mail_dict = {'hotel_name': hotel.get_name, 'site_name': settings.SITENAME, 'items': result}
             subject = 'booking/err_hotel_subject.txt'
             body = 'booking/err_hotel.txt'
             send_template_mail(subject, body, mail_dict, recipients)
开发者ID:Carlos-Mosquera,项目名称:nnmware,代码行数:26,代码来源:check_correct_hotel_info.py


示例3: booking_new_client_mail

def booking_new_client_mail(booking, username=''):
    if booking.email:
        recipients = [booking.email]
        mail_dict = {'booking': booking,
                    'site_name': settings.SITENAME, 'username': username}
        subject = 'booking/on_create_to_client_subject.txt'
        body = 'booking/on_create_to_client.txt'
        send_template_mail(subject,body,mail_dict,recipients)
开发者ID:MrTomato8,项目名称:nnmware,代码行数:8,代码来源:utils.py


示例4: new_order

def new_order(request):
    # Link used when User make order
    try:
        if not request.user.is_authenticated():
            raise AccessError
        if not check_basket(request.user):
            raise BasketError
        addr = request.POST.get('addr')
        address = DeliveryAddress.objects.get(user=request.user, pk=int(addr))
        order = Order()
        order.address = str(address)
        order.first_name = address.first_name
        order.middle_name = address.middle_name
        order.last_name = address.last_name
        order.user = request.user
        order.name = ''
        order.comment = ''
        order.status = STATUS_WAIT
        order.save()
        basket = Basket.objects.filter(user=request.user)
        for item in basket:
            order_item = OrderItem()
            order_item.order = order
            order_item.product_name = item.product.name
            order_item.product_origin = item.product
            order_item.product_url = item.product.get_absolute_url
            order_item.amount = item.product.amount
            order_item.product_pn = item.product.shop_pn
            order_item.quantity = item.quantity
            order_item.save()
            item.product.quantity -= item.quantity
            item.product.save()
        basket.delete()
        recipients = [settings.SHOP_MANAGER]
        mail_dict = {'order': order}
        subject = 'emails/neworder_admin_subject.txt'
        body = 'emails/neworder_admin_body.txt'
        send_template_mail(subject,body,mail_dict,recipients)
        try:
            recipients = [request.user.email]
            mail_dict = {'order': order}
            subject = 'emails/neworder_client_subject.txt'
            body = 'emails/neworder_client_body.txt'
            send_template_mail(subject,body,mail_dict,recipients)
        except:
            pass
        payload = {'success': True,'id':order.pk, 'location':order.get_absolute_url()}
    except AccessError:
        payload = {'success': False}
    except BasketError:
        payload = {'success': False, 'message':_('Product in basket not available')}
    except:
        payload = {'success': False}
    return AjaxLazyAnswer(payload)
开发者ID:MrTomato8,项目名称:nnmware,代码行数:54,代码来源:ajax.py


示例5: form_valid

 def form_valid(self, form):
     new_pw = form.cleaned_data.get('new_password2')
     self.request.user.set_password(new_pw)
     self.request.user.save()
     try:
         recipients = [self.request.user.email]
         mail_dict = {'new_pw': new_pw}
         subject = 'emails/changepass_client_subject.txt'
         body = 'emails/changepass_client_body.txt'
         send_template_mail(subject, body, mail_dict, recipients)
     except:
         pass
     return super(ChangePasswordView, self).form_valid(form)
开发者ID:biomassives,项目名称:nnmware,代码行数:13,代码来源:views.py


示例6: booking_new_hotel_mail

def booking_new_hotel_mail(booking):
    hotel_recipients = []
    if booking.hotel.email:
        hotel_recipients.append(booking.hotel.email)
    elif booking.hotel.contact_email:
        hotel_recipients.append(booking.hotel.contact_email)
    for admin in booking.hotel.admins.all():
        if admin.email:
            hotel_recipients.append(admin.email)
    mail_dict = {'booking': booking, 'site_name': SITENAME}
    subject = 'booking/on_create_to_hotel_subject.txt'
    body = 'booking/on_create_to_hotel.txt'
    send_template_mail(subject, body, mail_dict, hotel_recipients)
开发者ID:biomassives,项目名称:nnmware,代码行数:13,代码来源:utils.py


示例7: push_answer

def push_answer(request,object_id):
    try:
        f = Feedback.objects.get(pk=int(object_id))
        f.answer = request.POST.get('answer')
        recipients = [f.email]
        mail_dict = {'feedback': f}
        subject = 'emails/feedback_answer_subject.txt'
        body = 'emails/feedback_answer_body.txt'
        send_template_mail(subject,body,mail_dict,recipients)
        f.save()
        payload = {'success': True, 'location': f.get_absolute_url()}
    except :
        payload = {'success': False}
    return AjaxLazyAnswer(payload)
开发者ID:MrTomato8,项目名称:nnmware,代码行数:14,代码来源:ajax.py


示例8: push_answer

def push_answer(request, object_id):
    try:
        f = Feedback.objects.get(pk=int(object_id))
        f.answer = request.POST.get("answer")
        recipients = [f.email]
        mail_dict = {"feedback": f}
        subject = "emails/feedback_answer_subject.txt"
        body = "emails/feedback_answer_body.txt"
        send_template_mail(subject, body, mail_dict, recipients)
        f.save()
        payload = {"success": True, "location": f.get_absolute_url()}
    except:
        payload = {"success": False}
    return AjaxLazyAnswer(payload)
开发者ID:kingctan,项目名称:nnmware,代码行数:14,代码来源:ajax.py


示例9: form_valid

 def form_valid(self, form):
     self.object = form.save(commit=False)
     self.object.save()
     try:
         recipients = [self.request.user.email]
         mail_dict = {'order': self.object}
         if self.object.status == STATUS_PROCESS:
             subject = 'emails/status_process_subject.txt'
             body = 'emails/status_process_body.txt'
         if self.object.status == STATUS_SENT:
             subject = 'emails/status_sent_subject.txt'
             body = 'emails/status_sent_body.txt'
         send_template_mail(subject,body,mail_dict,recipients)
     except:
         pass
     return super(OrderStatusChange, self).form_valid(form)
开发者ID:MrTomato8,项目名称:nnmware,代码行数:16,代码来源:views.py


示例10: push_shopcallback

def push_shopcallback(request):
    """
    Its Ajax posted shop callback
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META["REMOTE_ADDR"]
        cb.user_agent = request.META["HTTP_USER_AGENT"]
        cb.clientname = request.POST.get("clientname")
        cb.clientphone = request.POST.get("clientphone")
        cb.save()
        mail_dict = {"callback": cb}
        recipients = [settings.SHOP_MANAGER]
        subject = "emails/callback_admin_subject.txt"
        body = "emails/callback_admin_body.txt"
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {"success": True}
    except:
        payload = {"success": False}
    return AjaxLazyAnswer(payload)
开发者ID:kingctan,项目名称:nnmware,代码行数:20,代码来源:ajax.py


示例11: form_valid

 def form_valid(self, form):
     email = form.cleaned_data.get('email')
     username = form.cleaned_data.get('username')
     password = form.cleaned_data.get('password2')
     try:
         e = EmailValidation.objects.get(email=email)
     except :
         e = EmailValidation()
         e.username = username
         e.email = email
         e.password = password
         e.created = datetime.now()
         e.key = make_key(username)
         e.save()
     mail_dict = {'key': e.key,
                  'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
                  'site_name': settings.SITENAME, 'email': email}
     subject = 'registration/activation_subject.txt'
     body = 'registration/activation.txt'
     send_template_mail(subject,body,mail_dict,[e.email])
     return super(SignupView, self).form_valid(form)
开发者ID:ksenor,项目名称:nnmware,代码行数:21,代码来源:views.py


示例12: push_quickorder

def push_quickorder(request):
    """
    Its Ajax posted shop quick order
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META['REMOTE_ADDR']
        cb.user_agent = request.META['HTTP_USER_AGENT']
        cb.clientname = request.POST.get('clientname')
        cb.clientphone = request.POST.get('clientphone')
        cb.description = request.POST.get('product_url')
        cb.quickorder = True
        cb.save()
        mail_dict = {'callback': cb}
        recipients = [settings.SHOP_MANAGER]
        subject = 'emails/quickorder_admin_subject.txt'
        body = 'emails/quickorder_admin_body.txt'
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {'success': True}
    except:
        payload = {'success': False}
    return ajax_answer_lazy(payload)
开发者ID:biomassives,项目名称:nnmware,代码行数:22,代码来源:ajax.py


示例13: handle

 def handle(self, *args, **options):
     activate("ru")
     for hotel in Hotel.objects.exclude(admins=None):
         result = []
         for room in hotel.room_set.all():
             avail = Availability.objects.filter(
                 room=room, date__range=(datetime.now(), datetime.now() + timedelta(days=13))
             ).count()
             if avail < 14:
                 avail_err = [room.get_name, _("Not filled availability")]
                 result.append(avail_err)
             for settlement in SettlementVariant.objects.filter(room=room, enabled=True):
                 if settlement.current_amount() is 0:
                     settlement_err = [
                         room.get_name,
                         _("Not filled price for %s-placed settlement") % settlement.settlement,
                     ]
                     result.append(settlement_err)
         if len(result) > 0:
             recipients = settings.BOOKING_MANAGERS
             mail_dict = {"hotel_name": hotel.get_name, "site_name": settings.SITENAME, "items": result}
             subject = "booking/err_hotel_subject.txt"
             body = "booking/err_hotel.txt"
             send_template_mail(subject, body, mail_dict, recipients)
开发者ID:MrTomato8,项目名称:nnmware,代码行数:24,代码来源:check_correct_hotel_info.py


示例14: request_add_hotel_mail

def request_add_hotel_mail(req_add):
    recipients = settings.BOOKING_MANAGERS
    mail_dict = {'req_add': req_add, 'site_name': settings.SITENAME}
    subject = 'booking/request_add_hotel_subject.txt'
    body = 'booking/request_add_hotel.txt'
    send_template_mail(subject,body,mail_dict,recipients)
开发者ID:MrTomato8,项目名称:nnmware,代码行数:6,代码来源:utils.py


示例15: send_new_order_buyer

def send_new_order_buyer(order, recipients):
    mail_dict = {'order': order}
    subject = 'emails/neworder_client_subject.txt'
    body = 'emails/neworder_client_body.txt'
    send_template_mail(subject, body, mail_dict, recipients)
开发者ID:nnmware,项目名称:nnmware,代码行数:5,代码来源:utils.py


示例16: send_new_order_seller

def send_new_order_seller(order):
    recipients = [settings.MARKET_MANAGER]
    mail_dict = {'order': order}
    subject = 'emails/neworder_admin_subject.txt'
    body = 'emails/neworder_admin_body.txt'
    send_template_mail(subject, body, mail_dict, recipients)
开发者ID:nnmware,项目名称:nnmware,代码行数:6,代码来源:utils.py



注:本文中的nnmware.core.utils.send_template_mail函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.setting函数代码示例发布时间:2022-05-27
下一篇:
Python action.send函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap