Fix bat file argument. Adding Company Name to address block. Add option to "un-send" an email. This marks the InvoiceSent column as False. You can then re-test and re-send the mail. This doesn't remove the original email history from the SentInvoice table, and resending the email will add a new record to the table. Orders can be un-sent via the Invoice Number or Order Number

This commit is contained in:
Dan Dembinski
2021-05-28 16:26:05 -04:00
parent 64d913572c
commit b83e181c47
4 changed files with 23 additions and 4 deletions

View File

@@ -44,6 +44,7 @@ def send_email(test, record):
# if ShippingCompany != 'None' and ShippingAddress2 == 'None':
block = '''
<br>{ShippingCompany}
<br>{name}
<br>{ShippingAddress1}
<br>{ShippingCity}, {ShippingState} {ShippingZip}
@@ -51,7 +52,7 @@ def send_email(test, record):
</p>
</td>
'''
addressBlock = block.format(name=Name, ShippingAddress1=ShippingAddress1, ShippingCity=ShippingCity,
addressBlock = block.format(ShippingCompany=ShippingCompany, name=Name, ShippingAddress1=ShippingAddress1, ShippingCity=ShippingCity,
ShippingState=ShippingState, ShippingZip=ShippingPostalCode)
@@ -179,7 +180,7 @@ def send_email(test, record):
f.close()
msg = MIMEMultipart()
msg['Subject'] = 'INVOICE ' + InvoiceNumber
msg['Subject'] = 'Payment Due: Invoice for CFF Portal Order ' + OrderNumber
if test is True:
msg['To'] = 'ddembinski@gll.com'
# msg['Cc'] = 'ddembinski@gll.com'
@@ -202,3 +203,4 @@ def send_email(test, record):
sent_orders.append(OrderNumber)
print(sent_orders)