Skip to content

fix: improve email notification subject - #3729

Merged
aicam merged 3 commits into
apache:mainfrom
seongjinyoon:feat/improve-subject-in-email-notification
Sep 12, 2025
Merged

aicam merged 3 commits into
apache:mainfrom
seongjinyoon:feat/improve-subject-in-email-notification

Conversation

@seongjinyoon

Copy link
Copy Markdown
Contributor

Description:
This PR fixes the previous implementation of enriching email subjects #3548 that aims to add the domain name in email subjects.

Problem:
The previous implementation used ConfigFactory.load() which reads from application.conf by default, but the user-sys.domain configuration is defined in user-system.conf, causing the domain retrieval to always fail and return empty strings.

Documentation: https://lightbend.github.io/config/latest/api/com/typesafe/config/ConfigFactory.html

Solution:
Replaced the incorrect domain retrieval with UserSystemConfig which properly reads from user-system.conf.

Closes #3720

Email Subject Updates:

"New Account Request Pending Approval" -> "New Account Request Pending Approval for [server-name]"
"Account Request Received"             -> "Account Request Received for [server-name]"
"Your Role Has Been Updated"           -> "Your Role Has Been Updated for [server-name]"

Example:
Screenshot 2025-09-11 at 2 16 26 PM

Copilot AI review requested due to automatic review settings September 11, 2025 22:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the domain retrieval logic for email notification subjects to properly read from the correct configuration file. The previous implementation incorrectly used ConfigFactory.load() which reads from application.conf, but the domain configuration is stored in user-system.conf.

  • Replaced ConfigFactory.load() with UserSystemConfig.appDomain for proper configuration access
  • Updated email subject formatting to use square brackets around the domain name
  • Ensured consistent domain inclusion across all email notification types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@seongjinyoon

Copy link
Copy Markdown
Contributor Author

@chenlica @bobbai00

@bobbai00 bobbai00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested on the staging server, works well. Left minor comments

@chenlica
chenlica requested a review from aicam September 12, 2025 16:13
@chenlica

Copy link
Copy Markdown
Contributor

@aicam Please also review this PR as you reviewed the earlier, related PR.

@aicam aicam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just address the comments

@aicam
aicam enabled auto-merge (squash) September 12, 2025 21:24
@aicam
aicam disabled auto-merge September 12, 2025 21:25

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@aicam
aicam requested a review from chenlica September 12, 2025 22:12
@chenlica

Copy link
Copy Markdown
Contributor

The change looks good to me. @aicam also tested it in a production server and it worked well.

@chenlica chenlica left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@aicam
aicam merged commit d349c49 into apache:main Sep 12, 2025
@seongjinyoon
seongjinyoon deleted the feat/improve-subject-in-email-notification branch September 12, 2025 23:40
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
**Description:**
This PR fixes the previous implementation of enriching email subjects
apache#3548 that aims to add the domain name in email subjects.

**Problem:**
The previous implementation used `ConfigFactory.load()` which reads from
`application.conf` by default, but the `user-sys.domain` configuration
is defined in `user-system.conf`, causing the domain retrieval to always
fail and return empty strings.

Documentation:
https://lightbend.github.io/config/latest/api/com/typesafe/config/ConfigFactory.html

**Solution:**
Replaced the incorrect domain retrieval with `UserSystemConfig` which
properly reads from `user-system.conf`.

Closes apache#3720 

**Email Subject Updates:**
```
"New Account Request Pending Approval" -> "New Account Request Pending Approval for [server-name]"
"Account Request Received"             -> "Account Request Received for [server-name]"
"Your Role Has Been Updated"           -> "Your Role Has Been Updated for [server-name]"
```

**Example:**
<img width="1484" height="710" alt="Screenshot 2025-09-11 at 2 16 26 PM"
src="https://github.com/user-attachments/assets/21f4d9cd-8642-407c-914d-51c91d6858bd"
/>

---------

Co-authored-by: Seongjin Yoon <[email protected]>
Co-authored-by: Seongjin Yoon <[email protected]>
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
**Description:**
This PR fixes the previous implementation of enriching email subjects
apache#3548 that aims to add the domain name in email subjects.

**Problem:**
The previous implementation used `ConfigFactory.load()` which reads from
`application.conf` by default, but the `user-sys.domain` configuration
is defined in `user-system.conf`, causing the domain retrieval to always
fail and return empty strings.

Documentation:
https://lightbend.github.io/config/latest/api/com/typesafe/config/ConfigFactory.html

**Solution:**
Replaced the incorrect domain retrieval with `UserSystemConfig` which
properly reads from `user-system.conf`.

Closes apache#3720 

**Email Subject Updates:**
```
"New Account Request Pending Approval" -> "New Account Request Pending Approval for [server-name]"
"Account Request Received"             -> "Account Request Received for [server-name]"
"Your Role Has Been Updated"           -> "Your Role Has Been Updated for [server-name]"
```

**Example:**
<img width="1484" height="710" alt="Screenshot 2025-09-11 at 2 16 26 PM"
src="https://github.com/user-attachments/assets/21f4d9cd-8642-407c-914d-51c91d6858bd"
/>

---------

Co-authored-by: Seongjin Yoon <[email protected]>
Co-authored-by: Seongjin Yoon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improving subject in email notifications

6 participants