mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Add basic flow for adding email _or_ sms templates
Templates now have: - a type (email or sms) - a subject (if they are email templates) We don’t want two completely separate view files for email and SMS, because they would have an enormous amount of repetition. So this commit adds - different templates for SMS and email templates - different form objects for SMS and email templates …and wires them up.
This commit is contained in:
@@ -4,12 +4,12 @@ from app.utils import BrowsableItem
|
||||
from notifications_python_client.errors import HTTPError
|
||||
|
||||
|
||||
def insert_service_template(name, content, service_id):
|
||||
def insert_service_template(name, content, service_id, subject=None):
|
||||
return notifications_api_client.create_service_template(
|
||||
name, 'sms', content, service_id)
|
||||
name, 'sms' if subject is None else 'email', content, service_id, subject)
|
||||
|
||||
|
||||
def update_service_template(id_, name, content, service_id):
|
||||
def update_service_template(id_, name, content, service_id, subject=None):
|
||||
return notifications_api_client.update_service_template(
|
||||
id_, name, 'sms', content, service_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user