mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
change email depending on day, add but comment out power off for 0 days
This commit is contained in:
parent
d9ee1ea26b
commit
b57279788d
2 changed files with 9 additions and 4 deletions
|
@ -23,9 +23,11 @@ def send_vm_expire_email(user, vms):
|
|||
subject = 'Proxstar VM Expiration Notice'
|
||||
body = "The following VMs in Proxstar are expiring soon:\n\n"
|
||||
for vm in vms:
|
||||
if vm[1] != 1:
|
||||
body += " - {} in {} days\n".format(vm[0], vm[1])
|
||||
if vm[1] == 0:
|
||||
body += " - {} today (VM has been stopped)\n".format(vm[0], vm[1])
|
||||
if vm[1] == 1:
|
||||
body += " - {} in 1 day\n".format(vm[0])
|
||||
else:
|
||||
body += " - {} in {} day\n".format(vm[0], vm[1])
|
||||
body += " - {} in {} days\n".format(vm[0], vm[1])
|
||||
body += "\nPlease login to Proxstar and renew any VMs you would like to keep."
|
||||
send_email(toaddr, subject, body)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue