Commit 22cfc406 authored by Patrick's avatar Patrick

Async send customer's mail to other customers/to management team

parent d785e9a4
# -*- coding: utf-8 # -*- coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import thread
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
...@@ -71,7 +72,8 @@ def send_mail_to_all_members_view(request): ...@@ -71,7 +72,8 @@ def send_mail_to_all_members_view(request):
from_email=request.user.email, from_email=request.user.email,
cc=to_email_customer cc=to_email_customer
) )
send_email(email=email, from_name=user_customer.long_basket_name) # send_email(email=email, from_name=user_customer.long_basket_name)
thread.start_new_thread(send_email,(email, user_customer.long_basket_name, True))
email = form.fields["your_email"] email = form.fields["your_email"]
email.initial = request.user.email email.initial = request.user.email
email.widget.attrs['readonly'] = True email.widget.attrs['readonly'] = True
......
# -*- coding: utf-8 # -*- coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import thread
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
...@@ -100,7 +101,8 @@ def send_mail_to_coordinators_view(request): ...@@ -100,7 +101,8 @@ def send_mail_to_coordinators_view(request):
to=to_email_customer, to=to_email_customer,
cc=to_email_staff cc=to_email_staff
) )
send_email(email=email) # send_email(email=email)
thread.start_new_thread(send_email, (email,))
# return HttpResponseRedirect('/') # return HttpResponseRedirect('/')
email = form.fields["your_email"] email = form.fields["your_email"]
email.initial = request.user.email email.initial = request.user.email
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment