Add category to moderator notification emails#507
Open
dthaler wants to merge 6 commits into
Open
Conversation
Add unit tests for moderator email methods Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the NotificationSystem’s email generation to include a whale category (e.g., SRKW vs transient vs humpback) in both moderator and subscriber notifications, and expands unit test coverage for the email template helpers.
Changes:
- Extend
EmailTemplateemail body/subject APIs to accept acategory, and addGetCategory(comments)+GetModeratorEmailSubject(...). - Update
SendModeratorEmail/SendSubscriberEmailto pass category into subjects/bodies. - Add/extend unit tests covering moderator email bodies/subjects and category derivation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| NotificationSystem/NotificationSystem/Template/EmailTemplate.cs | Adds category-aware email subject/body generation and GetCategory helper. |
| NotificationSystem/NotificationSystem/SendSubscriberEmail.cs | Passes a category into subscriber email subject/body generation. |
| NotificationSystem/NotificationSystem/SendModeratorEmail.cs | Derives category from document comments and uses it in moderator subject/body generation. |
| NotificationSystem/NotificationSystem.Tests.Unit/EmailTemplateTests.cs | Adds/updates unit tests for category-aware email methods and GetCategory. |
Comments suppressed due to low confidence (1)
NotificationSystem/NotificationSystem/Template/EmailTemplate.cs:146
- Same issue as subscriber email: the moderator template hardcodes "PDT" in the copy, which will be incorrect during standard time for some timestamps. Use a neutral label ("PT") or compute PST/PDT dynamically to match the actual conversion performed.
{category} Call Candidate
</h1>
<p>
Dear moderator, a potential {category} call was detected on {timeString} PDT at {location} location.
</p>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
tongwynn
reviewed
May 26, 2026
tongwynn
reviewed
May 26, 2026
tongwynn
reviewed
May 26, 2026
|
Historically, the system was developed to detect southern residents, which is why defaults and hard coding apply to them. It's only in the last few months that we've started giving serious thought to having multiple categories.
Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Tong W. ***@***.***>
Sent: Monday, May 25, 2026 10:31:38 PM
To: orcasound/orcahello ***@***.***>
Cc: David Bain ***@***.***>; Review requested ***@***.***>
Subject: Re: [orcasound/orcahello] Add category to moderator notification emails (PR #507)
@tongwynn commented on this pull request.
________________________________
In NotificationSystem/NotificationSystem/SendSubscriberEmail.cs<#507 (comment)>:
@@ -64,8 +64,9 @@ public async Task Run(
foreach (var message in messages)
{
string location = EmailTemplate.GetLocation(message);
- string emailSubject = EmailTemplate.GetSubscriberEmailSubject(location);
- string body = CreateBody(message);
+ string category = "Southern Resident Killer Whale";
why is the category hard coded?
—
Reply to this email directly, view it on GitHub<#507?email_source=notifications&email_token=AWBBIJYLYN4OK342PUQNSGD44UT3VA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMZWGA4DGMBVGMYKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-4360830530>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWBBIJ323HQ7AZZWY7HZ7LL44UT3VAVCNFSM6AAAAACZKPHBLKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DGNRQHAZTANJTGA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because your review was requested.Message ID: ***@***.***>
|
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Collaborator
Author
Also remove obsolete Haro Strait name since Orcasound Lab is already there in this test. Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
tongwynn
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.