mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5659] [Feature]: show {{EMAIL}} on first sub-body link only #3941
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3941
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ArrayKamko on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5659
Is your feature request related to a problem?
Please revert this commit:
github.com/MHSanaei/3x-ui@876d55f274to the previous state! Or add an option so that when it's enabled, the Email is displayed for all links!Describe the solution you'd like
Please revert this commit to the previous state! Or add an option so that when it's enabled, the Email is displayed for all links!
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 29, 2026):
The behavior you are describing is intentional in the current codebase and was introduced by the commit you referenced. Here is exactly what it does and why.
What the code does
internal/sub/remark_vars.godefinesfirstLinkOnlyBodyTokens(line 491), which is a set containing all usage/info tokens (TRAFFIC_LEFT,TRAFFIC_USED,DAYS_LEFT, etc.) plusEMAILandUSERNAME. TheeffectiveTemplate()function (lines 560–569) applies this filter: after the first link is emitted for a given client email, every subsequent link for that same client goes throughfilterRemarkTemplate(translated, firstLinkOnlyBodyTokens), which strips{{EMAIL}}and{{USERNAME}}from the remark template. The first link carries the email; all following links do not.This is the test that documents the intended contract:
TestEmailOnFirstLinkOnlyininternal/sub/remark_vars_test.go(line 614).The design rationale
All links in a single-client subscription share the same email, so repeating it on every link provides no extra information to a client app — it is treated the same as traffic statistics, which are also shown on the first link only. The intent was to reduce remark noise for users with many inbounds per subscription.
Your request
The request for a configurable option — e.g. a toggle that, when enabled, keeps
{{EMAIL}}on every link regardless of position — is reasonable. There is currently no such setting; the behavior is hardcoded ineffectiveTemplate(). Adding aSubServicefield (loaded from a panel setting) that, when set, bypasses thefirstLinkOnlyBodyTokensfilter for identity tokens while still applying it to usage tokens would address the use case without a full revert. The alternative, reverting the entire commit, would also restore the per-link traffic stats on every link, which was the original motivation for the change.If you or someone else wants to open a PR, the relevant code is entirely in
internal/sub/remark_vars.go(effectiveTemplate,firstLinkOnlyBodyTokens) and the setting would need to be loaded ininternal/sub/service.gofrom the panel settings (see howremarkTemplateis already loaded there).This reply was generated automatically; a maintainer may follow up.
@moshkinura commented on GitHub (Jul 6, 2026):
I agree with that.