Skip to content
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

21560 - EFT Payment reminder template updates #2991

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Payment Due Today
# Payment Due for {{ account_number }}: {{ account_name_with_branch }}

## {{ account_number }}: {{ account_name_with_branch }}
{% if short_name_links_count > 1 %}
There's an amount owing on your account for your {{ statement_month }} statement (#{{ statement_number }}), which is due today {{ due_date }}.
{% else %}
There's an amount owing of {{ total_amount_owing }} on your account for your {{ statement_month }} statement (#{{ statement_number }}), which is due today {{ due_date }}.
{% endif %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible to combine these a bit more?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPT:

{% set owing_message = "There's an amount owing" %}
{% set amount_details = '' if short_name_links_count > 1 else ' of {{ total_amount_owing }}' %}
{{ owing_message }}{{ amount_details }} on your account for your {{ statement_month }} statement (#{{ statement_number }}), which is due today {{ due_date }}.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, I prefer the whole sentence rather trying to combine fragments though when we have to modify it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, then you'll be modifying it twice if the base sentence needs to change


There's an amount owing on your recent statement due on {{ due_date }}.
{% if short_name_links_count > 1 %}
If you've made a payment recently, please verify that you've paid the full amount indicated on your statement and settle any remaining balance by {{ due_date }}. This will help ensure the smooth processing of your account and services.
{% else %}
To avoid any disruptions to your services, please make your payment as soon as possible.
{% endif %}

To avoid any disruptions to your services, please make your payment as soon as possible.

[Log in to view your {{ statement_frequency }} statement]({{ payment_statement_url }})
[Log in to view your {{ statement_frequency }} statements]({{ payment_statement_url }})

If you've recently made a payment, please disregard this message.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Payment Reminder
# Payment Reminder for {{ account_number }}: {{ account_name_with_branch }}

## {{ account_number }}: {{ account_name_with_branch }}
{% if short_name_links_count > 1 %}
There's an amount owing on your account for your {{ statement_month }} statement (#{{ statement_number }}).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

{% else %}
There's an amount owing of {{ total_amount_owing }} on your account for your {{ statement_month }} statement (#{{ statement_number }}).
{% endif %}

There's an amount owing on your recent statement due on {{ due_date }}.
{% if short_name_links_count > 1 %}
Please settle your remaining balance before {{ due_date }}. This will help ensure the smooth processing of your account and services.
{% else %}
If you've made a payment recently, please verify that you've paid the full amount indicated on your statement and settle any remaining balance by {{ due_date }}. This will help ensure the smooth processing of your account and services.
{% endif %}

[Log in to view your {{ statement_frequency }} statement]({{ payment_statement_url }})

If you've recently made a payment, please disregard this message.
[Log in to view your {{ statement_frequency }} statements]({{ payment_statement_url }})

**Business Registry**
BC Registries and Online Services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,10 @@ def handle_payment_reminder_or_due(message_type, email_msg):
'logo_url': logo_url,
'due_date': due_date.strftime('%B ') + format_day_with_suffix(due_date.day) + f' {due_date.year}',
'total_amount_owing': format_currency(email_msg.get('totalAmountOwing')),
'statement_frequency': email_msg.get('statementFrequency').lower()
'statement_frequency': email_msg.get('statementFrequency').lower(),
'statement_month': email_msg.get('statementMonth'),
'statement_number': email_msg.get('statementNumber'),
'short_name_links_count': email_msg.get('shortNameLinksCount'),
})
process_email(email_dict)

Expand Down
10 changes: 8 additions & 2 deletions queue_services/account-mailer/tests/unit/test_worker_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,10 @@ def test_payment_reminder_notification_email(app, session, client):
'dueDate': '2023-09-15 00:00:00',
'emailAddresses': '[email protected]',
'statementFrequency': 'MONTHLY',
'totalAmountOwing': 351.5
'statementMonth': 'August',
'statementNumber': 12345,
'totalAmountOwing': 351.5,
'shortNameLinksCount': 1
}
helper_add_event_to_queue(client,
message_type=QueueMessageTypes.PAYMENT_REMINDER_NOTIFICATION.value,
Expand All @@ -513,7 +516,10 @@ def test_payment_due_notification_email(app, session, client):
'dueDate': '2023-09-15 00:00:00',
'emailAddresses': '[email protected]',
'statementFrequency': 'MONTHLY',
'totalAmountOwing': 351.5
'statementMonth': 'August',
'statementNumber': 12345,
'totalAmountOwing': 351.5,
'shortNameLinksCount': 1
}
helper_add_event_to_queue(client,
message_type=QueueMessageTypes.PAYMENT_DUE_NOTIFICATION.value,
Expand Down
Loading