как добавить чтобы был дубль письма заказа на вторую почту сайта администратора СКРЫТНО
def send_email(request):
zakaz = OrderItem.objects.filter(number_order=order, number_order__user_order=user_order).select_related('number_order').prefetch_related(
'number_order__nomer_order', 'number_order__user_order__discount_list_k1').values()
subject = f"Заказ № {order}"
message = render_to_string('shop/email.html', {'user': request.user.first_name, 'order': order, 'comment': cd['comment_order'], 'zakaz': zakaz})
from_email = "[email protected]"
if subject and message and from_email:
try:
msg = EmailMultiAlternatives(subject, message, from_email, [request.user.email])
msg.attach_alternative(message, "text/html")
msg.send()
except BadHeaderError:
return HttpResponse("Invalid header found.")
return HttpResponseRedirect("/created/")
else:
return HttpResponse("Make sure all fields are entered and valid.")
send_email(request)