Skip to content

Commit

Permalink
Fixed issue with bcc'ing FOIL Officers on requests
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbcastillo committed Jul 15, 2016
1 parent a6fec4d commit 8bbf47f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions public_records_portal/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@
def generate_prr_emails(
request_id,
notification_type,
notification_content
notification_content,
department_id = None
):
# 'text=None' is used additional information.
# 'text2=None' is used if there are more variable text passed into email such as with 'close this request' and being offered multiple reasons
app.logger.info("def generate_prr_emails")
req = Request.query.filter_by(id=request_id).first();
dept_id = req.department_id
if request_id:
req = Request.query.filter_by(id=request_id).first();
dept_id = req.department_id
else:
dept_id = department_id
user_id = Department.query.filter_by(id=dept_id).first().primary_contact_id
foil_officer_email = User.query.filter_by(id=user_id).first().email
bcc = [foil_officer_email]
Expand Down
6 changes: 4 additions & 2 deletions public_records_portal/prr.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ def nonportal_request(request_body):
notification_content['contact_info'] = contact_info
generate_prr_emails(request_id=None,
notification_type='non-portal-agency_agency',
notification_content=notification_content)
notification_content=notification_content,
department_id=notification_content['department'].id)

notification_content['recipient'] = request_body['request_email']
generate_prr_emails(request_id=None,
notification_type='non-portal-agency_requester',
notification_content=notification_content)
notification_content=notification_content,
department_id=notification_content['department'].id)
return 1


Expand Down

0 comments on commit 8bbf47f

Please sign in to comment.