Fix server-name caching and include server name in email body#15
Merged
dmccoystephenson merged 1 commit intoMay 17, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request addresses two related notification-quality issues by (1) caching the configured server name once at startup and (2) ensuring the server name is included in the email body content, aligning the body with the subject and improving clarity for multi-server setups.
Changes:
- Cache
server-nameduringHerald.loadConfiguration()and reuse it for join notifications. - Update
EmailNotifier.notifyPlayerJoin()so the email body includes theserverName. - Update
EmailNotifierTestassertions to verify the server name appears in the email body.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/com/dansplugins/herald/Herald.java | Caches serverName at configuration load time and uses it when sending join notifications. |
| src/main/java/com/dansplugins/herald/EmailNotifier.java | Adds serverName into the email body format for join notifications. |
| src/test/java/com/dansplugins/herald/EmailNotifierTest.java | Updates tests to assert the new email body format includes the server name. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
dmccoystephenson
added a commit
that referenced
this pull request
May 17, 2026
* Add Unreleased section to CHANGELOG for PR #15 fixes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add reference link definitions to CHANGELOG Fixes broken link-style headings flagged in Copilot review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
server-nameat load time (Herald.java):server-namewas being read from config on everyPlayerJoinEvent. It is now read once inloadConfiguration()and stored as aserverNamefield, matching how Discord and email settings are handled.EmailNotifier.java): The email body said"Steve has joined the server at <date>"— it never mentioned which server. It now reads"Steve has joined MySurvivalServer at <date>", consistent with the email subject.EmailNotifierTest.java): Assertions that checked the old body format are updated to verify the server name is present.Test plan
./gradlew build -x testsucceeds./gradlew clean testpasses all testsCloses #13
Closes #14