From a94c16029f5fdeaecb3fd219753742cdb9140614 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Fri, 23 Aug 2024 16:21:46 -0700 Subject: [PATCH 1/6] - added attachment for RESUBMITTED continuation in - added subjects for other statuses/options - created APPROVED email template - created CHANGE_REQUESTED email template - created REJECTED email template - created RESUBMITTED email template --- .../continuation_in_notification.py | 30 +++++++- .../email_templates/CONT-IN-APPROVED.html | 67 ++++++++++++++++++ .../CONT-IN-CHANGE_REQUESTED.html | 56 +++++++++++++++ .../email_templates/CONT-IN-REJECTED.html | 69 +++++++++++++++++++ .../email_templates/CONT-IN-RESUBMITTED.html | 65 +++++++++++++++++ .../src/entity_emailer/worker.py | 6 ++ 6 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-APPROVED.html create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-RESUBMITTED.html diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py index db09add5e5..d05a2c8e0a 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py @@ -66,6 +66,7 @@ def _get_pdfs( ) attach_order += 1 + # add receipt corp_name = business.get('legalName') receipt = requests.post( f'{current_app.config.get("PAY_API_URL")}/{filing.payment_token}/receipts', @@ -91,6 +92,22 @@ def _get_pdfs( } ) attach_order += 1 + + elif status == 'RESUBMITTED': + # add filing pdf + filing_pdf_type = 'continuationIn' + filing_pdf_encoded = get_filing_document(business['identifier'], filing.id, filing_pdf_type, token) + if filing_pdf_encoded: + pdfs.append( + { + 'fileName': 'Continuation Application - Resubmitted.pdf', + 'fileBytes': filing_pdf_encoded.decode('utf-8'), + 'fileUrl': '', + 'attachOrder': str(attach_order) + } + ) + attach_order += 1 + elif status == Filing.Status.COMPLETED.value: # add certificate of continuation certificate_pdf_type = 'certificateOfContinuation' @@ -105,6 +122,7 @@ def _get_pdfs( } ) attach_order += 1 + # add notice of articles noa_pdf_type = 'noticeOfArticles' noa_encoded = get_filing_document(business['identifier'], filing.id, noa_pdf_type, token) @@ -118,13 +136,14 @@ def _get_pdfs( } ) attach_order += 1 + return pdfs def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-locals, , too-many-branches """Build the email for Continuation notification.""" logger.debug('filing_notification: %s', email_info) - # get template and fill in parts + # get template vars from email info filing_type, status = email_info['type'], email_info['option'] # get template vars from filing filing, business, leg_tmz_filing_date, leg_tmz_effective_date = get_filing_info(email_info['filingId']) @@ -134,6 +153,7 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l business = filing_data['nameRequest'] business['identifier'] = filing.temp_reg + # 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) # render template with vars @@ -183,6 +203,14 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l subject = 'Confirmation of Filing from the Business Registry' elif status == Filing.Status.COMPLETED.value: subject = 'Continuation Documents from the Business Registry' + elif status == Filing.Status.CHANGE_REQUESTED.value: + subject = 'Change Requested from the Business Registry' + elif status == Filing.Status.APPROVED.value: + subject = 'Results of your Filing from the Business Registry' + elif status == Filing.Status.REJECTED.value: + subject = 'Results of your Filing from the Business Registry' + elif status == 'RESUBMITTED': + subject = 'Confirmation of Filing from the Business Registry' subject = f'{legal_name} - {subject}' if legal_name else subject diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-APPROVED.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-APPROVED.html new file mode 100644 index 0000000000..22469b085a --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-APPROVED.html @@ -0,0 +1,67 @@ + + + + + + + + + Results of your Continuation Application + [[style.html]] + + + + + + + + + + diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html new file mode 100644 index 0000000000..04dc657959 --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html @@ -0,0 +1,56 @@ + + + + + + + + + Results of your Continuation Application + [[style.html]] + + + + + + + + + + diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html new file mode 100644 index 0000000000..07b0b5f4c9 --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html @@ -0,0 +1,69 @@ + + + + + + + + + Results of your Continuation Application + [[style.html]] + + + + + + + + + + diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-RESUBMITTED.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-RESUBMITTED.html new file mode 100644 index 0000000000..deb02aecf8 --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-RESUBMITTED.html @@ -0,0 +1,65 @@ + + + + + + + + + Confirmation of Filing from the Business Registry + [[style.html]] + + + + + + + + + + diff --git a/queue_services/entity-emailer/src/entity_emailer/worker.py b/queue_services/entity-emailer/src/entity_emailer/worker.py index 0a6c866cb9..83471384c5 100644 --- a/queue_services/entity-emailer/src/entity_emailer/worker.py +++ b/queue_services/entity-emailer/src/entity_emailer/worker.py @@ -268,3 +268,9 @@ async def cb_subscription_handler(msg: nats.aio.client.Msg): email_msg, tracker_msg, error_details) + +import asyncio +event_loop = asyncio.get_event_loop() +event_loop.run_until_complete(process_email({ + "email": {"filingId": 150512, "type": "continuationIn", "option": "CHANGE_REQUESTED"} +}, FLASK_APP)) From ff21c45c2e0443a30555c624648d129b6454eced Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Mon, 26 Aug 2024 13:42:21 -0700 Subject: [PATCH 2/6] - added latest_review_comment template variable - updated Rejected template --- .../continuation_in_notification.py | 25 +++++++++++++------ .../CONT-IN-CHANGE_REQUESTED.html | 2 +- .../email_templates/CONT-IN-REJECTED.html | 6 +++-- .../src/entity_emailer/worker.py | 3 ++- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py index d05a2c8e0a..f788774f0a 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py @@ -24,7 +24,7 @@ from entity_queue_common.service_utils import logger from flask import current_app from jinja2 import Template -from legal_api.models import Business, Filing +from legal_api.models import Business, Filing, ReviewResult from entity_emailer.email_processors import ( get_entity_dashboard_url, @@ -143,8 +143,10 @@ def _get_pdfs( def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-locals, , too-many-branches """Build the email for Continuation notification.""" logger.debug('filing_notification: %s', email_info) + # get template vars from email info filing_type, status = email_info['type'], email_info['option'] + # get template vars from filing filing, business, leg_tmz_filing_date, leg_tmz_effective_date = get_filing_info(email_info['filingId']) filing_name = filing.filing_type[0].upper() + ' '.join(re.findall('[a-zA-Z][^A-Z]*', filing.filing_type[1:])) @@ -152,14 +154,11 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l if status == Filing.Status.PAID.value: business = filing_data['nameRequest'] business['identifier'] = filing.temp_reg - - # 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) - # render template with vars legal_type = business.get('legalType') numbered_description = Business.BUSINESSES.get(legal_type, {}).get('numberedDescription') - 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 # compute Foreign Jurisdiction string as in report.py and business_document.py country_code = filing_data['foreignJurisdiction']['country'] @@ -170,6 +169,12 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l region = pycountry.subdivisions.get(code=f'{country_code}-{region_code}') foreign_jurisdiction = f'{region.name}, {country.name}' if region else country.name + # 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) + + # render template with vars html_out = jnja_template.render( business=business, filing=filing_data, @@ -181,9 +186,13 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l email_header=filing_name.upper(), filing_type=filing_type, numbered_description=numbered_description, - foreign_jurisdiction=foreign_jurisdiction + foreign_jurisdiction=foreign_jurisdiction, + latest_review_comment=latest_review_comment ) + # decode newlines to
for html output + html_out = html_out.replace('\\n', '
') + # get attachments pdfs = _get_pdfs(status, token, diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html index 04dc657959..8346fe8b04 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-CHANGE_REQUESTED.html @@ -36,7 +36,7 @@
  • Modify the application to satisfy the request from staff as described below:
  • -

    {Note from staff goes here.}

    +
    {{ latest_review_comment }}
    [[20px.html]] [[divider.html]] diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html index 07b0b5f4c9..945368e0f9 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-REJECTED.html @@ -20,7 +20,9 @@

    Results of your Continuation Application

    -

    Your Continuation Authorization is rejected.

    +

    Your Continuation Authorization is rejected and a refund request + has been submitted. The refund will be applied to your original payment method. Refunds + are usually processed within 10-14 business days.

    [[20px.html]] [[divider.html]] @@ -31,7 +33,7 @@
    1. Review the reasons for rejected as outlined below:
    2. -

      {Note from staff goes here.}

      +
      {{ latest_review_comment }}
    3. Visit BC Business Registry account to submit a new Continuation Application.
    diff --git a/queue_services/entity-emailer/src/entity_emailer/worker.py b/queue_services/entity-emailer/src/entity_emailer/worker.py index 83471384c5..90ece63267 100644 --- a/queue_services/entity-emailer/src/entity_emailer/worker.py +++ b/queue_services/entity-emailer/src/entity_emailer/worker.py @@ -269,8 +269,9 @@ async def cb_subscription_handler(msg: nats.aio.client.Msg): tracker_msg, error_details) +# *** TODO: remove this after debugging *** import asyncio event_loop = asyncio.get_event_loop() event_loop.run_until_complete(process_email({ - "email": {"filingId": 150512, "type": "continuationIn", "option": "CHANGE_REQUESTED"} + "email": {"filingId": 150390, "type": "continuationIn", "option": "REJECTED"} }, FLASK_APP)) From 18263b7c631477d5758f1c2858e2642d3cef673c Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Tue, 27 Aug 2024 09:56:17 -0700 Subject: [PATCH 3/6] - removed debugging code --- queue_services/entity-emailer/src/entity_emailer/worker.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/queue_services/entity-emailer/src/entity_emailer/worker.py b/queue_services/entity-emailer/src/entity_emailer/worker.py index 90ece63267..0a6c866cb9 100644 --- a/queue_services/entity-emailer/src/entity_emailer/worker.py +++ b/queue_services/entity-emailer/src/entity_emailer/worker.py @@ -268,10 +268,3 @@ async def cb_subscription_handler(msg: nats.aio.client.Msg): email_msg, tracker_msg, error_details) - -# *** TODO: remove this after debugging *** -import asyncio -event_loop = asyncio.get_event_loop() -event_loop.run_until_complete(process_email({ - "email": {"filingId": 150390, "type": "continuationIn", "option": "REJECTED"} -}, FLASK_APP)) From acda58cbc2968fee9abd1a3fdb14353d14c4c645 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 28 Aug 2024 13:12:09 -0700 Subject: [PATCH 4/6] - sorted subject if-else conditions - expanded continuation in tests --- .../continuation_in_notification.py | 12 +++--- .../test_continuation_in_notification.py | 41 +++++++++++++++---- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py index f788774f0a..5e78f49d78 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py @@ -208,14 +208,14 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l # assign subject legal_name = business.get('legalName', None) - if status == Filing.Status.PAID.value: - subject = 'Confirmation of Filing from the Business Registry' - elif status == Filing.Status.COMPLETED.value: - subject = 'Continuation Documents from the Business Registry' + if status == Filing.Status.APPROVED.value: + subject = 'Results of your Filing from the Business Registry' elif status == Filing.Status.CHANGE_REQUESTED.value: subject = 'Change Requested from the Business Registry' - elif status == Filing.Status.APPROVED.value: - subject = 'Results of your Filing from the Business Registry' + elif status == Filing.Status.COMPLETED.value: + subject = 'Continuation Documents from the Business Registry' + elif status == Filing.Status.PAID.value: + subject = 'Confirmation of Filing from the Business Registry' elif status == Filing.Status.REJECTED.value: subject = 'Results of your Filing from the Business Registry' elif status == 'RESUBMITTED': diff --git a/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py b/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py index d64a37647b..4a012d2b25 100644 --- a/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py +++ b/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py @@ -21,15 +21,20 @@ from tests.unit import prep_continuation_in_filing -@pytest.mark.parametrize('status', [ - (Filing.Status.PAID.value), - (Filing.Status.COMPLETED.value) +@pytest.mark.parametrize(['status', 'subject'], [ + (Filing.Status.APPROVED.value, ''), + (Filing.Status.CHANGE_REQUESTED.value, ''), + (Filing.Status.COMPLETED.value, ''), + (Filing.Status.PAID.value, ''), + (Filing.Status.REJECTED.value, ''), + ('RESUBMITTED', ''), ]) -def test_continuation_in_notification(app, session, mocker, status): +def test_continuation_in_notification(app, session, mocker, status, subject): """Assert Continuation notification is created.""" # setup filing + business for email filing = prep_continuation_in_filing(session, 'C1234567', '1', status) token = 'token' + # test processor mocker.patch( 'entity_emailer.email_processors.continuation_in_notification.get_entity_dashboard_url', @@ -39,16 +44,36 @@ def test_continuation_in_notification(app, session, mocker, status): {'filingId': filing.id, 'type': 'continuationIn', 'option': status}, token) assert 'test@test.com' in email['recipients'] - if status == Filing.Status.PAID.value: + + if status == Filing.Status.APPROVED.value: assert email['content']['subject'] == \ - 'HAULER MEDIA INC. - Confirmation of Filing from the Business Registry' - assert 'comp_party@email.com' in email['recipients'] - else: + 'Results of your Filing from the Business Registry' + + elif status == Filing.Status.CHANGE_REQUESTED.value: + assert email['content']['subject'] == \ + 'Change Requested from the Business Registry' + + elif status == Filing.Status.COMPLETED.value: assert mock_get_pdfs.call_args[0][2]['identifier'] == 'C1234567' assert email['content']['subject'] == 'Continuation Documents from the Business Registry' + elif status == Filing.Status.PAID.value: + assert email['content']['subject'] == \ + 'HAULER MEDIA INC. - Confirmation of Filing from the Business Registry' + assert 'comp_party@email.com' in email['recipients'] + + elif status == Filing.Status.REJECTED.value: + assert email['content']['subject'] == \ + 'Results of your Filing from the Business Registry' + + elif status == 'RESUBMITTED': + assert email['content']['subject'] == \ + 'Confirmation of Filing from the Business Registry' + assert email['content']['body'] assert email['content']['attachments'] == [] assert mock_get_pdfs.call_args[0][0] == status assert mock_get_pdfs.call_args[0][1] == token assert mock_get_pdfs.call_args[0][3] == filing + + # FUTURE: verify some html_out content From cad7cb5b56da79c3687b25cacec0c53b7121c1ba Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 28 Aug 2024 14:13:46 -0700 Subject: [PATCH 5/6] - updated unit test --- .../test_continuation_in_notification.py | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py b/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py index 4a012d2b25..4e54b462dd 100644 --- a/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py +++ b/queue_services/entity-emailer/tests/unit/email_processors/test_continuation_in_notification.py @@ -21,15 +21,15 @@ from tests.unit import prep_continuation_in_filing -@pytest.mark.parametrize(['status', 'subject'], [ - (Filing.Status.APPROVED.value, ''), - (Filing.Status.CHANGE_REQUESTED.value, ''), - (Filing.Status.COMPLETED.value, ''), - (Filing.Status.PAID.value, ''), - (Filing.Status.REJECTED.value, ''), - ('RESUBMITTED', ''), +@pytest.mark.parametrize('status', [ + (Filing.Status.APPROVED.value), + (Filing.Status.CHANGE_REQUESTED.value), + (Filing.Status.COMPLETED.value), + (Filing.Status.PAID.value), + (Filing.Status.REJECTED.value), + ('RESUBMITTED'), ]) -def test_continuation_in_notification(app, session, mocker, status, subject): +def test_continuation_in_notification(app, session, mocker, status): """Assert Continuation notification is created.""" # setup filing + business for email filing = prep_continuation_in_filing(session, 'C1234567', '1', status) @@ -44,36 +44,36 @@ def test_continuation_in_notification(app, session, mocker, status, subject): {'filingId': filing.id, 'type': 'continuationIn', 'option': status}, token) assert 'test@test.com' in email['recipients'] + assert email['content']['body'] + assert email['content']['attachments'] == [] + assert mock_get_pdfs.call_args[0][0] == status + assert mock_get_pdfs.call_args[0][1] == token + assert mock_get_pdfs.call_args[0][3] == filing + # spot check email content based on status if status == Filing.Status.APPROVED.value: - assert email['content']['subject'] == \ - 'Results of your Filing from the Business Registry' + assert email['content']['subject'] == 'Results of your Filing from the Business Registry' + assert 'your business has been continued in' in email['content']['body'] elif status == Filing.Status.CHANGE_REQUESTED.value: - assert email['content']['subject'] == \ - 'Change Requested from the Business Registry' + assert email['content']['subject'] == 'Change Requested from the Business Registry' + assert 'resubmit your application' in email['content']['body'] elif status == Filing.Status.COMPLETED.value: - assert mock_get_pdfs.call_args[0][2]['identifier'] == 'C1234567' assert email['content']['subject'] == 'Continuation Documents from the Business Registry' + assert 'have successfully registered' in email['content']['body'] + assert mock_get_pdfs.call_args[0][2]['identifier'] == 'C1234567' elif status == Filing.Status.PAID.value: assert email['content']['subject'] == \ 'HAULER MEDIA INC. - Confirmation of Filing from the Business Registry' + assert 'Receipt' in email['content']['body'] assert 'comp_party@email.com' in email['recipients'] elif status == Filing.Status.REJECTED.value: - assert email['content']['subject'] == \ - 'Results of your Filing from the Business Registry' + assert email['content']['subject'] == 'Results of your Filing from the Business Registry' + assert 'rejected' in email['content']['body'] elif status == 'RESUBMITTED': - assert email['content']['subject'] == \ - 'Confirmation of Filing from the Business Registry' - - assert email['content']['body'] - assert email['content']['attachments'] == [] - assert mock_get_pdfs.call_args[0][0] == status - assert mock_get_pdfs.call_args[0][1] == token - assert mock_get_pdfs.call_args[0][3] == filing - - # FUTURE: verify some html_out content + assert email['content']['subject'] == 'Confirmation of Filing from the Business Registry' + assert 'your updated' in email['content']['body'] From 60951c7d981693d4f20ff92e33442441308dbc45 Mon Sep 17 00:00:00 2001 From: Severin Beauvais Date: Wed, 28 Aug 2024 14:19:01 -0700 Subject: [PATCH 6/6] - used "in" to reduce duplication --- .../email_processors/continuation_in_notification.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py index 5e78f49d78..149d3660e4 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/continuation_in_notification.py @@ -208,17 +208,13 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l # assign subject legal_name = business.get('legalName', None) - if status == Filing.Status.APPROVED.value: + if status in [Filing.Status.APPROVED.value, Filing.Status.REJECTED.value]: subject = 'Results of your Filing from the Business Registry' elif status == Filing.Status.CHANGE_REQUESTED.value: subject = 'Change Requested from the Business Registry' elif status == Filing.Status.COMPLETED.value: subject = 'Continuation Documents from the Business Registry' - elif status == Filing.Status.PAID.value: - subject = 'Confirmation of Filing from the Business Registry' - elif status == Filing.Status.REJECTED.value: - subject = 'Results of your Filing from the Business Registry' - elif status == 'RESUBMITTED': + elif status in [Filing.Status.PAID.value, 'RESUBMITTED']: subject = 'Confirmation of Filing from the Business Registry' subject = f'{legal_name} - {subject}' if legal_name else subject