|
|
@@ -25,6 +25,7 @@ import_module('order.models', ['Order', 'ShippingAddress', 'CommunicationEventTy
|
|
25
|
25
|
import_module('order.utils', ['OrderNumberGenerator', 'OrderCreator'], locals())
|
|
26
|
26
|
import_module('address.models', ['UserAddress'], locals())
|
|
27
|
27
|
import_module('shipping.repository', ['Repository'], locals())
|
|
|
28
|
+import_module('customer.models', ['Email'], locals())
|
|
28
|
29
|
|
|
29
|
30
|
logger = logging.getLogger('oscar.checkout')
|
|
30
|
31
|
|
|
|
@@ -326,10 +327,13 @@ class PaymentDetailsView(CheckoutView):
|
|
326
|
327
|
if self.request.user.is_authenticated():
|
|
327
|
328
|
# Send email
|
|
328
|
329
|
logger.info(_("Order #%s: sending confirmation email" % order.number))
|
|
329
|
|
- email = EmailMessage(subject='Subject', body='Body', to=[self.request.user.email])
|
|
|
330
|
+ email = EmailMessage('Subject', 'Body', to=[self.request.user.email])
|
|
330
|
331
|
email.send()
|
|
331
|
332
|
|
|
332
|
333
|
# If user is signed in, save email in history
|
|
|
334
|
+ Email._default_manager.create(user=self.request.user,
|
|
|
335
|
+ subject=email.subject,
|
|
|
336
|
+ body_text=email.body)
|
|
333
|
337
|
|
|
334
|
338
|
# Create order communication event
|
|
335
|
339
|
self.create_order_placed_event(order)
|