Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20142 Revert sending an attachment with "consent received" emails #1526

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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