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

Acknowledgement Email Point of Contact #587

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions app/constants/schemas/agencies.schema
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"description": "An array of agency EINs. Each EIN must be unique. Used to notify a \"parent\" agency of requests submitted to the \"child\"",
"uniqueItems": true
},
"use_point_of_contact": {
"$id": "/properties/agencies/items/properties/agency_features/properties/use_point_of_contact",
"type": "boolean",
"title": "Use Point of Contact",
"description": "Boolean value that determines if point of contact information should be used in email templates.",
},
"letters": {
"generate_letters": {
"$id": "/properties/agencies/items/properties/agency_features/properties/letters/properties/generate_letters",
Expand Down
9 changes: 8 additions & 1 deletion app/response/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,9 @@ def _acknowledgment_email_handler(request_id, data, page, agency_name, email_tem
else:
description_hidden_by_default = False

# Determine if point of contact should be used
use_point_of_contact = request.agency.agency_features.get('use_point_of_contact', False)

if acknowledgment is not None:
acknowledgment = json.loads(acknowledgment)
default_content = True
Expand All @@ -1165,11 +1168,13 @@ def _acknowledgment_email_handler(request_id, data, page, agency_name, email_tem
acknowledgment['date'],
data['tz_name'])
info = acknowledgment['info'].strip() or None
point_of_contact = assign_point_of_contact(acknowledgment.get('point_of_contact', None))
else:
default_content = False
content = data['email_content']
date = None
info = None
point_of_contact = None
return jsonify({"template": render_template(email_template,
custom_request_forms_enabled=custom_request_forms_enabled,
default_content=default_content,
Expand All @@ -1180,7 +1185,9 @@ def _acknowledgment_email_handler(request_id, data, page, agency_name, email_tem
agency_name=agency_name,
date=date,
info=info,
page=page),
page=page,
use_point_of_contact=use_point_of_contact,
point_of_contact=point_of_contact),
"header": header}), 200


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
{{ info | safe }}
<br/><br/>
{% endif %}
{% if use_point_of_contact %}
<p>Your request has been assigned to {{ point_of_contact.title }} {{ point_of_contact.last_name }}
({{ point_of_contact.formatted_point_of_contact_number }}) of this office.</p>
{% endif %}
Please visit <a href="{{ page }}">{{ request_id }}</a> to view additional information and take any necessary action.
</div>
{% else %}
Expand Down
3 changes: 2 additions & 1 deletion app/templates/response/add_acknowledgment.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@
acknowledgment: JSON.stringify({
days: email_days.val(),
date: email_date.val(),
info: tinyMCE.get('acknowledgment-email-info-text').getContent()
info: tinyMCE.get('acknowledgment-email-info-text').getContent(),
point_of_contact: point_of_contact.val()
}),
tz_name: jstz.determine().name()
},
Expand Down