Skip to content

Add category to moderator notification emails#507

Open
dthaler wants to merge 6 commits into
orcasound:mainfrom
dthaler:notify-category
Open

Add category to moderator notification emails#507
dthaler wants to merge 6 commits into
orcasound:mainfrom
dthaler:notify-category

Conversation

@dthaler
Copy link
Copy Markdown
Collaborator

@dthaler dthaler commented May 23, 2026

  • If the "comments" field is populated in unreviewed detections, use it to get a category to use in the emails.
  • Instead of just saying "Orca" for SRKW in one place, use "Southern Resident Killer Whale" for consistency.
  • Instead of saying "PDT" when it is actually PST for half the year, just say "Pacific"
  • Add unit tests for moderator email methods

Add unit tests for moderator email methods

Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 EmailTemplate email body/subject APIs to accept a category, and add GetCategory(comments) + GetModeratorEmailSubject(...).
  • Update SendModeratorEmail/SendSubscriberEmail to 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>

Comment thread NotificationSystem/NotificationSystem/SendModeratorEmail.cs Outdated
Comment thread NotificationSystem/NotificationSystem/SendModeratorEmail.cs Outdated
Comment thread NotificationSystem/NotificationSystem/SendSubscriberEmail.cs Outdated
Comment thread NotificationSystem/NotificationSystem/Template/EmailTemplate.cs Outdated
Comment thread NotificationSystem/NotificationSystem.Tests.Unit/EmailTemplateTests.cs Outdated
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread NotificationSystem/NotificationSystem/SendModeratorEmail.cs Outdated
Comment thread NotificationSystem/NotificationSystem/Template/EmailTemplate.cs
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
@dthaler dthaler requested review from TruaShamu and dbainj1 May 25, 2026 15:02
@dthaler dthaler changed the title Add category to notification emails Add category to moderator notification emails May 25, 2026
@dthaler dthaler requested a review from tongwynn May 26, 2026 01:17
Comment thread NotificationSystem/NotificationSystem/Template/EmailTemplate.cs
Comment thread NotificationSystem/NotificationSystem/Template/EmailTemplate.cs Outdated
Comment thread NotificationSystem/NotificationSystem/SendSubscriberEmail.cs
@dbainj1
Copy link
Copy Markdown

dbainj1 commented May 26, 2026 via email

Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
@dthaler
Copy link
Copy Markdown
Collaborator Author

dthaler commented May 26, 2026

FYI, I would like to merge #508 (which adds more tests) before this PR, and rebase this on top of it before this is merged. So I need reviews of #508 too, thanks!

Also remove obsolete Haro Strait name since Orcasound Lab
is already there in this test.

Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants