Improve admin email logging
This commit is contained in:
parent
8cd7a69162
commit
cc03c11c4a
1 changed files with 6 additions and 0 deletions
|
@ -1558,6 +1558,7 @@ class VirtualMachineView(LoginRequiredMixin, View):
|
||||||
|
|
||||||
# Cancel Stripe subscription
|
# Cancel Stripe subscription
|
||||||
stripe_utils = StripeUtils()
|
stripe_utils = StripeUtils()
|
||||||
|
hosting_order = None
|
||||||
try:
|
try:
|
||||||
hosting_order = HostingOrder.objects.get(
|
hosting_order = HostingOrder.objects.get(
|
||||||
vm_id=vm.id
|
vm_id=vm.id
|
||||||
|
@ -1643,6 +1644,11 @@ class VirtualMachineView(LoginRequiredMixin, View):
|
||||||
email = BaseEmail(**email_data)
|
email = BaseEmail(**email_data)
|
||||||
email.send()
|
email.send()
|
||||||
admin_email_body.update(response)
|
admin_email_body.update(response)
|
||||||
|
admin_email_body["customer_email"] = owner.email
|
||||||
|
admin_email_body["VM_ID"] = vm.id
|
||||||
|
admin_email_body["VM_created_at"] = (str(hosting_order.created_at) if
|
||||||
|
hosting_order is not None
|
||||||
|
else "unknown")
|
||||||
admin_msg_sub = "VM and Subscription for VM {} and user: {}".format(
|
admin_msg_sub = "VM and Subscription for VM {} and user: {}".format(
|
||||||
vm.id,
|
vm.id,
|
||||||
owner.email
|
owner.email
|
||||||
|
|
Loading…
Reference in a new issue