Fixed a problem in email sending when attach/embed flag was removed.

This commit is contained in:
JohnKent
2019-07-10 23:12:21 -04:00
parent af033464ad
commit 8bc23dc8b1
2 changed files with 3 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
{ {
"htmlTemplate": "statement.pdf.jinja",
"parameters": { "parameters": {
"monthly_payment": 589.0, "monthly_payment": 589.0,
"interest_rate": 6.5, "interest_rate": 6.5,
@@ -12,8 +11,6 @@
"periods_per_year": 12, "periods_per_year": 12,
"periods": 18 "periods": 18
}, },
"format": "html",
"txtTemplate": "statement.txt.jinja",
"lender": { "lender": {
"city": "Washington", "city": "Washington",
"name": "Test Lender", "name": "Test Lender",
@@ -100,15 +97,11 @@
"address": "301 N Beauregard St Apt 203" "address": "301 N Beauregard St Apt 203"
}, },
"email": { "email": {
"body": "Your test loan statement is attached.",
"to_address": "jkent3rd@gmail.com", "to_address": "jkent3rd@gmail.com",
"from_address": "jkent3rd@gmail.com", "from_address": "jkent3rd@gmail.com",
"text": "Please see your most recent test account statement.", "subject": "Your test loan statement...",
"body": "Your test loan statement is attached.",
"server": "smtp.gmail.com", "server": "smtp.gmail.com",
"send_text": "true", "password": "pvyrbcnzrjoizprn"
"template": "./template.txt",
"send_pdf": "true",
"password": "pvyrbcnzrjoizprn",
"subject": "Your test loan statement..."
} }
} }

3
web.py
View File

@@ -104,7 +104,6 @@ def send_statement():
loanFile = request.form["loan"] loanFile = request.form["loan"]
subject = request.form["subject"] subject = request.form["subject"]
message = request.form["message"] message = request.form["message"]
style = request.form["style"]
loan = loadLoanInformation(getFullPathofLoanFile(loanFile)) loan = loadLoanInformation(getFullPathofLoanFile(loanFile))
amortizeLoan(loan) amortizeLoan(loan)
@@ -119,8 +118,6 @@ def send_statement():
if 'pdf' in request.form: if 'pdf' in request.form:
pdfInterimReport = transformTemplate(selectTemplate('pdf'), loan) pdfInterimReport = transformTemplate(selectTemplate('pdf'), loan)
pdfReport = createPDF(pdfInterimReport) pdfReport = createPDF(pdfInterimReport)
if style == 'embed':
style = 'attach'
reportCreated = True reportCreated = True
if ('html' in request.form) or (reportCreated is False): if ('html' in request.form) or (reportCreated is False):