From acec461489cca119932e52cf1f1c031d6f025252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9verin=20Beauvais?= Date: Tue, 20 Aug 2024 14:17:33 -0700 Subject: [PATCH] 22290 Updated continuation "PAID" email (#2934) * - added template parts to list and updated comments - added foreign jurisdiction computation and included it in continuation in variables - updated CONT-IN-PAID template to match UI designs - added some "true" whitespace template partsf and updated comments - added template part for continuation application details - added class to style and update title message whitespace - updated a comment for future * - added "- Pending" to continuation application attachment name * - changed "EXPRO" check to "business" check * - deleted debugging code --------- Co-authored-by: Severin Beauvais --- .../email_processors/__init__.py | 15 +++++--- .../continuation_in_notification.py | 15 +++++++- .../email_templates/CONT-IN-PAID.html | 37 +++++++++++++------ .../email_templates/common/16px.html | 3 ++ .../email_templates/common/20px.html | 2 + .../email_templates/common/24px.html | 3 ++ .../email_templates/common/8px.html | 3 ++ .../continuation-application-details.html | 25 +++++++++++++ .../email_templates/common/style.html | 5 ++- .../common/whitespace-16px.html | 3 +- .../common/whitespace-24px.html | 3 +- .../entity_emailer/message_tracker/tracker.py | 2 +- 12 files changed, 92 insertions(+), 24 deletions(-) create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/common/16px.html create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/common/24px.html create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/common/8px.html create mode 100644 queue_services/entity-emailer/src/entity_emailer/email_templates/common/continuation-application-details.html diff --git a/queue_services/entity-emailer/src/entity_emailer/email_processors/__init__.py b/queue_services/entity-emailer/src/entity_emailer/email_processors/__init__.py index fa75ab7b5b..57454c8615 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_processors/__init__.py +++ b/queue_services/entity-emailer/src/entity_emailer/email_processors/__init__.py @@ -166,15 +166,17 @@ def substitute_template_parts(template_code: str) -> str: Template parts are marked by [[partname.html]] in templates. This functionality is restricted by: - - markup must be exactly [[partname.html]] and have no extra spaces around file name - - template parts can only be one level deep, ie: this rudimentary framework does not handle nested template - parts. There is no recursive search and replace. + - Markup must be exactly [[partname.html]] and have no extra spaces around the file name. + - Some nesting is supported: earlier templates can include later templates. Hence, the order of + template parts, below, is important. + - Do not comment out template parts as they may be replaced anyway! """ template_parts = [ 'business-dashboard-link', 'business-dashboard-link-alt', 'business-info', 'business-information', + 'continuation-application-details', 'reg-business-info', 'cra-notice', 'nr-footer', @@ -183,11 +185,14 @@ def substitute_template_parts(template_code: str) -> str: 'initiative-notice', 'logo', 'pdf-notice', - 'style', 'divider', + '8px', + '16px', '20px', + '24px', 'whitespace-16px', - 'whitespace-24px' + 'whitespace-24px', + 'style' ] # substitute template parts - marked up by [[filename]] 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 5a023ba793..db09add5e5 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 @@ -19,6 +19,7 @@ from http import HTTPStatus from pathlib import Path +import pycountry import requests from entity_queue_common.service_utils import logger from flask import current_app @@ -57,7 +58,7 @@ def _get_pdfs( if filing_pdf_encoded: pdfs.append( { - 'fileName': 'Continuation Application.pdf', + 'fileName': 'Continuation Application - Pending.pdf', 'fileBytes': filing_pdf_encoded.decode('utf-8'), 'fileUrl': '', 'attachOrder': str(attach_order) @@ -140,6 +141,15 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l numbered_description = Business.BUSINESSES.get(legal_type, {}).get('numberedDescription') jnja_template = Template(filled_template, autoescape=True) + # compute Foreign Jurisdiction string as in report.py and business_document.py + country_code = filing_data['foreignJurisdiction']['country'] + region_code = filing_data['foreignJurisdiction']['region'] + country = pycountry.countries.get(alpha_2=country_code) + region = None + if region_code and region_code.upper() != 'FEDERAL': + region = pycountry.subdivisions.get(code=f'{country_code}-{region_code}') + foreign_jurisdiction = f'{region.name}, {country.name}' if region else country.name + html_out = jnja_template.render( business=business, filing=filing_data, @@ -150,7 +160,8 @@ def process(email_info: dict, token: str) -> dict: # pylint: disable=too-many-l entity_dashboard_url=get_entity_dashboard_url(business.get('identifier'), token), email_header=filing_name.upper(), filing_type=filing_type, - numbered_description=numbered_description + numbered_description=numbered_description, + foreign_jurisdiction=foreign_jurisdiction ) # get attachments diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-PAID.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-PAID.html index 88e8798dc6..b457355858 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-PAID.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/CONT-IN-PAID.html @@ -17,33 +17,46 @@ [[header.html]]
-

We have received your continuation application.

+ +

We have received your Continuation Application

- [[business-information.html]] +

BC Registries will review your Continuation Authorization documents and contact you + with the results within 2 business days.

+ + [[20px.html]] + [[divider.html]] + [[20px.html]] + + + [[continuation-application-details.html]] + + [[20px.html]] + [[divider.html]] + [[20px.html]] + + +

Attached to this Email

The following documents are attached to this email:

    -
  • Continuation Application
  • +
  • Continuation Application - Pending
  • Receipt
- [[whitespace-16px.html]] [[business-dashboard-link.html]] - [[whitespace-16px.html]] + [[8px.html]] +

- Once your filing has been processed, the business will be registered, and the company will receive the - below outputs: + Once your authorization has been approved, your business will be registered and you will + receive the following outputs:

  • Notice of Articles
  • Certificate of Continuation
- [[whitespace-16px.html]] - [[pdf-notice.html]] - - [[whitespace-16px.html]] - [[20px.html]] + + [[24px.html]] [[footer.html]]
diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/16px.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/16px.html new file mode 100644 index 0000000000..2af16c02b4 --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/16px.html @@ -0,0 +1,3 @@ + + +

diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/20px.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/20px.html index bd0e24dd2a..48beab022c 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/20px.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/20px.html @@ -1 +1,3 @@ + +

diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/24px.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/24px.html new file mode 100644 index 0000000000..4935ec2791 --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/24px.html @@ -0,0 +1,3 @@ + + +

diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/8px.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/8px.html new file mode 100644 index 0000000000..db1f01d28d --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/8px.html @@ -0,0 +1,3 @@ + + +

diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/continuation-application-details.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/continuation-application-details.html new file mode 100644 index 0000000000..9e16411631 --- /dev/null +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/continuation-application-details.html @@ -0,0 +1,25 @@ +
+

Your Continuation Application Details

+
+
Identifying Number in Foreign Jurisdiction:
+
{{ filing.foreignJurisdiction.identifier }}
+
+ [[16px.html]] +
+
Name in Foreign Jurisdiction:
+
{{ filing.foreignJurisdiction.legalName }}
+
+ [[16px.html]] +
+
Foreign Jurisdiction:
+
{{ foreign_jurisdiction }}
+
+ + {% if filing.business %} + [[16px.html]] +
+
Extraprovincial Registration Number in B.C.:
+
{{ filing.business.identifier }}
+
+ {% endif %} +
diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/style.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/style.html index 55a2271d6d..e435deeb2c 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/style.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/style.html @@ -74,7 +74,7 @@ .title-message { font-size: 24px; - line-height: 34px; + padding-bottom: 16px; } .container { @@ -85,7 +85,8 @@ text-transform: uppercase; } -.business-information .value { +.business-information .value, +.continuation-application-details .value { line-height: 24px; } diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-16px.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-16px.html index be5b1687e6..db7bccd1a5 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-16px.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-16px.html @@ -1,2 +1,3 @@ - + +

 

diff --git a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-24px.html b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-24px.html index d847b98016..008c0a9ab3 100644 --- a/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-24px.html +++ b/queue_services/entity-emailer/src/entity_emailer/email_templates/common/whitespace-24px.html @@ -1,2 +1,3 @@ - + +

 

diff --git a/queue_services/entity-emailer/src/entity_emailer/message_tracker/tracker.py b/queue_services/entity-emailer/src/entity_emailer/message_tracker/tracker.py index 30eb9390ab..6d76dc475f 100644 --- a/queue_services/entity-emailer/src/entity_emailer/message_tracker/tracker.py +++ b/queue_services/entity-emailer/src/entity_emailer/message_tracker/tracker.py @@ -109,7 +109,7 @@ def get_message_context_properties(queue_msg: nats.aio.client.Msg): 'restoration', 'specialResolution', 'correction', 'amalgamationApplication', 'continuationIn') \ and (option := email.get('option', None)) \ and (filing_id := email.get('filingId', None)): - # option contains current status of filing - PAID or COMPLETED + # option contains current status of filing - PAID or COMPLETED or CHANGE_REQUESTED, etc message_id = f'{etype}_{option}_{filing_id}' return create_message_context_properties(etype, message_id, None, None, False)