mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 14:49:49 -04:00
Sprinkle letter throughout the app
Let users create/edit/delete letter templates. Let them upload a CSV file or send a test against a letter template. Big assumption at the moment is that addresses only have one line, and therefore one column in the CSV file.
This commit is contained in:
@@ -11,14 +11,15 @@ from notifications_python_client.errors import HTTPError
|
||||
|
||||
from app.main import main
|
||||
from app.utils import user_has_permissions
|
||||
from app.main.forms import SMSTemplateForm, EmailTemplateForm
|
||||
from app.main.forms import SMSTemplateForm, EmailTemplateForm, LetterTemplateForm
|
||||
from app.main.views.send import get_example_csv_rows
|
||||
from app import service_api_client, current_service, template_statistics_client
|
||||
|
||||
|
||||
form_objects = {
|
||||
'email': EmailTemplateForm,
|
||||
'sms': SMSTemplateForm
|
||||
'sms': SMSTemplateForm,
|
||||
'letter': LetterTemplateForm
|
||||
}
|
||||
|
||||
page_headings = {
|
||||
@@ -74,8 +75,10 @@ def view_template_version(service_id, template_id, version):
|
||||
@login_required
|
||||
@user_has_permissions('manage_templates', admin_override=True)
|
||||
def add_service_template(service_id, template_type):
|
||||
if template_type not in ['sms', 'email']:
|
||||
if template_type not in ['sms', 'email', 'letter']:
|
||||
abort(404)
|
||||
if not current_service['can_send_letters'] and template_type == 'letter':
|
||||
abort(403)
|
||||
|
||||
form = form_objects[template_type]()
|
||||
if form.validate_on_submit():
|
||||
|
||||
Reference in New Issue
Block a user