bcgov / bcgov/STRR

Bug: Missing Template for `PLATFORM_REGISTRATION_CANCELLED` Emails

Open Beginner friendly
#1,712 0 comments 0 reactions 0 assignees View on GitHub
bug STR
Dominant language
Python
Stars
2
Forks
22
Avg merge
2d 35m
Merged PRs (30d)
11

Description

### Description

The email service is failing to send notifications when a platform registration is cancelled. The system attempts to process the incoming Pub/Sub message but encounters a `FileNotFoundError` because the required Markdown template (`strr-PLATFORM_REGISTRATION_CANCELLED.md`) is missing from the `email-templates` directory. This is causing a **500 Internal Server Error** on the `strr-email` service.

> Edit: found another missing template: `strr-STRATA_HOTEL_REGISTRATION_ACTIVE.md`

---

### Error Logs

GCP Logs Explorer link

```json
2026-06-04 13:49:12.385 localhost strr_email[10] ERROR Exception on / [POST]
Traceback (most recent call last):
...
return io.open(self, mode, buffering, encoding, errors, newline)
FileNotFoundError: [Errno 2] No such file or directory: 'email-templates/strr-PLATFORM_REGISTRATION_CANCELLED.md'
```

---

### Steps to Reproduce

1. Trigger a platform registration cancellation event from the `strr-api` service.
2. The `strr-emailer--sub` subscription delivers the payload to the email service.
3. Observe the `strr-email-` service logs.

### Expected Result

The email service successfully locates the `strr-PLATFORM_REGISTRATION_CANCELLED.md` template, injects the context variable (`customContent`, `registrationNumber`), and dispatches the email.

### Actual Result

The application crashes with a `FileNotFoundError` and returns an HTTP 500 status code back to the message broker.

---
### Proposed Solution

1. Create the missing template files:
1. `email-templates/strr-PLATFORM_REGISTRATION_CANCELLED.md`.
2. `email-templates/strr-STRATA_HOTEL_REGISTRATION_ACTIVE.md`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in the email-templates directory and inspect the email service flow that handles the incoming Pub/Sub payload. Create strr-PLATFORM_REGISTRATION_CANCELLED.md and strr-STRATA_HOTEL_REGISTRATION_ACTIVE.md using the expected customContent and registrationNumber context, then verify both events no longer produce FileNotFoundError or an HTTP 500 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, python
Domain
backend, cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.