mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
fix placeholders not appearing in email subject
it now switches utils.template.Template type, since the base Template type now no longer has a subject attribute. updated test case to use `sample_email_template_with_placeholders` instead of `sample_email_template`
This commit is contained in:
@@ -4,7 +4,7 @@ from flask import current_app
|
||||
from notifications_utils.recipients import (
|
||||
RecipientCSV
|
||||
)
|
||||
from notifications_utils.template import Template
|
||||
from notifications_utils.template import SMSMessageTemplate, WithSubjectTemplate
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from app import (
|
||||
create_uuid,
|
||||
@@ -48,9 +48,10 @@ def process_job(job_id):
|
||||
job.job_status = 'in progress'
|
||||
dao_update_job(job)
|
||||
|
||||
template = Template(
|
||||
dao_get_template_by_id(job.template_id, job.template_version).__dict__
|
||||
)
|
||||
db_template = dao_get_template_by_id(job.template_id, job.template_version)
|
||||
|
||||
TemplateClass = SMSMessageTemplate if db_template.template_type == SMS_TYPE else WithSubjectTemplate
|
||||
template = TemplateClass(db_template.__dict__)
|
||||
|
||||
for row_number, recipient, personalisation in RecipientCSV(
|
||||
s3.get_job_from_s3(str(service.id), str(job_id)),
|
||||
|
||||
Reference in New Issue
Block a user