[Feature] Add opt-in SMTP email delivery for new notifications
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, spring, spring-boot
- Domain
- api, authentication, backend
Research direction
Start with NotificationChannel.java and NotificationService.java in server/skillhub-notification, then read docs/19-smtp-password-reset-email-setup.md for the existing SMTP setup. Trace how notification preferences and event handling are stored and exposed before estimating the work. Done means opt-in email delivery meets the listed transaction, retry, deduplication, recipient eligibility, preference, and documentation criteria while preserving in-app and password-reset behavior.
Written by the indexing model from the issue text.
Description
Problem
Users who are away from the SkillHub web UI can miss new notifications, such as a pending review, a review decision, or an update to a subscribed skill. This can delay approvals and make subscriptions less useful for people who do not keep the site open.
In v0.2.23, notification delivery is limited to the in-app channel:
- NotificationChannel defines only
IN_APP, withEMAILlisted as a future extension. - NotificationService.create checks the in-app preference and persists a notification, without email delivery.
- SMTP is already documented for password-reset verification emails, but configuring it does not enable notification emails.
The default branch's channel enum also still lists only IN_APP at the time of this request.
Example: A namespace admin receives a new review request while the browser is closed. An email with a brief summary and a link to the review page would let them discover and act on the request promptly.
Proposed Solution
Add an optional EMAIL delivery channel for existing notification events, alongside in-app notifications.
Suggested initial scope:
- Operator enablement: Reuse the existing Spring Mail/SMTP transport configuration. Add a separate notification-email enable flag and sender settings with documented defaults; keep delivery disabled by default for existing installations.
- User preferences: Allow users to opt in or out of email independently for the existing
PUBLISH,REVIEW,PROMOTION, andREPORTcategories. Disabling in-app notifications should not implicitly disable an explicitly enabled email channel. - Recipients and content: Use the recipient's eligible account email under the project's email trust policy. If none is available, skip email with a clear setting/status message. Include the event summary and a link built from the configured instance URL. Keep private details minimal and retain authorization checks when the link is opened.
- Delivery behavior: Send asynchronously after the triggering transaction commits. SMTP failure must not roll back publishing/review actions or prevent the in-app notification from being stored. Provide bounded retries and deduplication for normal event reprocessing, with observable terminal failures.
- Manageability: Include a link to notification preferences and support existing interface languages where practical.
Suggested acceptance criteria:
- With SMTP configured, operator enablement on, and a category opted in, an eligible new event generates an email even when the recipient has no browser session.
- Operator disablement and per-category opt-out suppress notification emails.
- In-app and email preferences work independently.
- A rolled-back transaction sends no email; SMTP errors leave the business action and in-app notification intact.
- Missing/ineligible recipient email is handled explicitly, without sending to an untrusted fallback address.
- Tests cover successful delivery, preferences, transaction boundaries, failure/retry behavior, and duplicate event processing.
- Operator documentation explains configuration, sender identity, expected delivery behavior, and troubleshooting.
Digests, chat integrations, arbitrary recipient addresses, and a general notification-rules engine can remain separate follow-ups.
Alternatives Considered
- In-app notifications only: Useful while using the site, but do not reach users who are away from it.
- External polling scripts or database integrations: Require each deployment to reproduce recipient selection, authorization, preferences, and delivery handling.
- Email digests first: Could reduce volume, but add scheduling and aggregation to the initial scope. Per-event opt-in delivery would address the immediate need.
Impact
- UX: Add an email channel and delivery-eligibility guidance to notification settings.
- Backend/persistence: Extend channel handling and preference storage as needed. Any durable delivery tracking should use an additive migration.
- Deployment: Reuse SMTP credentials and document new notification-specific settings for supported deployment methods.
- Observability: Expose delivery failures and retry exhaustion without logging credentials or sensitive message bodies.
- Compatibility: Preserve current in-app behavior and password-reset email behavior when notification email is disabled.
Contract Or SDK Impact
The notification preference API and channel enum would gain EMAIL; update OpenAPI and regenerate affected web types/SDKs if these contracts change. No CLI protocol change is requested. Update operator and user documentation.
This is a feature proposal for maintainer discussion; the exact configuration names and delivery implementation can follow the project's architecture conventions.
- Dominant language
- Java
- Stars
- 5.2k
- Forks
- 841
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 77
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from iflytek/skillhub
-
effort/l priority/p2 risk/high triage/deferred
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
iflytek/skillhub#1039 · 1 comment ·
Maintainers usually reply within 1 day
-
effort/s priority/p3 triage/deferred
Difficulty 4/5 3-5 days Newbie friendliness 49/100
iflytek/skillhub#1042 · 1 comment ·
Maintainers usually reply within 1 day
-
effort/l priority/p2 risk/high triage/deferred
Difficulty 3/5 1-2 days Newbie friendliness 57/100
iflytek/skillhub#1036 · 2 comments ·
Maintainers usually reply within 1 day
-
[Feature] 面向非技术用户的 skill 展示:中文展示名/简介/能力说明 + 首页推荐板块Possibly taken @XiaoSeS claimed this 2 days ago. Openeffort/l priority/p1 risk/high triage/core
iflytek/skillhub#1035 · 5 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[Feature] RFC:默认关闭的厂商中立后端业务事件出口 / Opt-in backend business-event exportPossibly taken @xiaoyaner0201 claimed this 2 days ago. Openeffort/l priority/p1 risk/high triage/core
Difficulty 5/5 Over a week Newbie friendliness 25/100
iflytek/skillhub#1009 · 2 comments ·
Maintainers usually reply within 1 day
All issues in iflytek/skillhub
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
IdentityArrayObjectSet iterator remove may throw ArrayIndexOutOfBoundsExceptionPossibly taken @jiteshkhatri11 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
javapathfinder/jpf-core#660 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
breaking change bug needs human review not ready priority medium size S
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
martin-francois/symphony-trello#1193 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day