-
Notifications
You must be signed in to change notification settings - Fork 73
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
22363 Continuation in email templates #2946
Conversation
- added subjects for other statuses/options - created APPROVED email template - created CHANGE_REQUESTED email template - created REJECTED email template - created RESUBMITTED email template
- updated Rejected template
db81ab4
to
cc6abe1
Compare
- expanded continuation in tests
Please review this PR. It's for the emails as we know them right now. It's likely they will change but this way we don't lose the work done so far (as it will be in the commit history). There are no new unit test errors. |
'attachOrder': str(attach_order) | ||
} | ||
) | ||
attach_order += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resubmitted is similar to "submitted" (ie, paid) except no receipt is attached.
jnja_template = Template(filled_template, autoescape=True) | ||
review_result = ReviewResult.get_last_review_result(filing.id) | ||
# encode newlines in review comment only | ||
latest_review_comment = review_result.comments.replace('\n', '\\n') if review_result else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# get template and fill in parts | ||
template = Path(f'{current_app.config.get("TEMPLATE_PATH")}/CONT-IN-{status}.html').read_text() | ||
filled_template = substitute_template_parts(template) | ||
jnja_template = Template(filled_template, autoescape=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simply moved a few things around to make sense, ie:
- first prepare the variables
- then get the template
- finally, render it
<li>Modify the application to satisfy the request from staff as described below:</li> | ||
</ol> | ||
|
||
<pre class="bold">{{ latest_review_comment }}</pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-formatted looked the best to me (see sample above).
queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py
Outdated
Show resolved
Hide resolved
..._services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
..._services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Issue #: bcgov/entity#22363
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).