mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Return rendered HTML when previewing a template
If you’re trying to show what a Notify email will look like in your caseworking system all the API gives you at the moment is raw markdown (with the placeholders replaced). This isn’t that useful if your caseworkers have no idea what markdown is. If we also give teams the HTML then they can embed this in their systems, and the people using those systems will be able to see how headings, bulleted lists, etc. look.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from app.models import SMS_TYPE, TEMPLATE_TYPES
|
||||
from app.schema_validation.definitions import uuid, personalisation
|
||||
from app.utils import get_html_email_body_from_template
|
||||
|
||||
|
||||
get_template_by_id_request = {
|
||||
@@ -79,6 +80,7 @@ def create_post_template_preview_response(template, template_object):
|
||||
"type": template.template_type,
|
||||
"version": template.version,
|
||||
"body": str(template_object),
|
||||
"html": get_html_email_body_from_template(template_object),
|
||||
"subject": subject,
|
||||
"postage": template.postage
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user