Skip to content

Commit

Permalink
don't send an attachment with consent received emails (#1526)
Browse files Browse the repository at this point in the history
  • Loading branch information
semmatti authored Apr 29, 2024
1 parent 00ea588 commit 1c9be5d
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions api/namex/resources/name_requests/report_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def email_consent_letter(self, nr_id):
if not nr_model:
return jsonify(message='{nr_id} not found'.format(nr_id=nr_model.id)), HTTPStatus.NOT_FOUND
nr_model.consentFlag = 'R' # invariant: this function is only called when the consent letter has been received
report, status_code = ReportResource._get_report(nr_model)
if status_code != HTTPStatus.OK:
return jsonify(message=str(report)), status_code
report_name = nr_model.nrNum + ' - ' + CONSENT_EMAIL_SUBJECT
recipient_emails = []
for applicant in nr_model.applicants:
Expand All @@ -59,20 +56,12 @@ def email_consent_letter(self, nr_id):
file_name = f"{file_name}-{instruction_group}"
email_template = Path(f'{template_path}/emails/{file_name}.md').read_text()
email_body = ReportResource._build_email_body(email_template, nr_model)
attachments = [
{
'fileName': report_name.replace(' - ', ' ').replace(' ', '_') + '.pdf',
'fileBytes': base64.b64encode(report).decode(),
'fileUrl': '',
'attachOrder': 1
}
]
email = {
'recipients': recipients,
'content': {
'subject': report_name,
'body': email_body,
'attachments': attachments
'attachments': []
}
}
return ReportResource._send_email(email)
Expand Down

0 comments on commit 1c9be5d

Please sign in to comment.