mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-11 17:46:29 -05:00
Custom mail templates are ignored, but registered #10586
Closed
opened 2025-11-02 09:12:02 -06:00 by GiteaMirror
·
1 comment
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1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rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#10586
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 @dsvictory on GitHub (Apr 2, 2023).
Description
After creating some custom templates (issue/comment.tmpl and issue/default.tmpl) with minimal html I see their registration in logs but they are never used. With any actions in gitea I always get the same built-in template in my mail. There are no fails or any other errors in logs. All is ok, but custom mail templates don't work. And I tried it with all other action types and names.
My trace logs after gitea launching:
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for auth/reset_passwd
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for auth/activate
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for team_invite
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for auth/activate_email
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for release
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for issue/default
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for auth/register_notify
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for issue/assigned
2023/04/02 19:41:46 .../templates/mailer.go:46:func1() [T] Adding built-in mailer template for notify/repo_transfer
2023/04/02 19:41:46 .../templates/mailer.go:68:1() [T] Adding mailer template for \issue\comment from "C:\gitea\custom\templates\mail\issue\comment.tmpl"
2023/04/02 19:41:46 .../templates/mailer.go:68:1() [T] Adding mailer template for \issue\default from "C:\gitea\custom\templates\mail\issue\default.tmpl"
2023/04/02 19:41:46 ...s/process/manager.go:170:Add() [T] Start 6429780a-21: Queue: notification-service-channel (system)
2023/04/02 19:41:46 ...s/process/manager.go:170:Add() [T] Start 6429780a-20: Watcher: Mailer Templates (system)
2023/04/02 19:41:46 ...les/queue/manager.go:149:Add() [T] Queue Manager registered: notification-service-channel (QID: 4)
2023/04/02 19:41:46 ...s/watcher/watcher.go:48:run() [T] [6429780a-20] Watcher loop starting for Mailer Templates
2023/04/02 19:41:46 ...s/process/manager.go:170:Add() [T] Start 6429780a-22: Queue: notification-service-level (system)
2023/04/02 19:41:46 ...les/queue/manager.go:149:Add() [T] Queue Manager registered: notification-service-level (QID: 5)
2023/04/02 19:41:46 ...s/watcher/watcher.go:60:func1() [T] [6429780a-20] Watcher: Mailer Templates watching "C:\gitea\custom\templates\mail"
2023/04/02 19:41:46 ...les/queue/manager.go:149:Add() [T] Queue Manager registered: notification-service (QID: 6)
2023/04/02 19:41:46 ...ueue_disk_channel.go:159:Run() [D] [6429780a-21] PersistableChannelQueue: notification-service Starting
2023/04/02 19:41:46 .../queue/workerpool.go:283:commonRegisterWorkers() [T] [6429780a-21] WorkerPool: 4 (for notification-service-channel) adding 0 workers with group id: 1
2023/04/02 19:41:46 ...ueue_disk_channel.go:196:Run() [D] [6429780a-21] PersistableChannelQueue: notification-service Skipping running the empty level queue
2023/04/02 19:41:46 ...ue/queue_bytefifo.go:327:Shutdown() [T] [6429780a-21] level: notification-service-level Shutting down
2023/04/02 19:41:46 ...ue/queue_bytefifo.go:334:Shutdown() [D] [6429780a-21] level: notification-service-level Shutdown
2023/04/02 19:41:46 ...les/queue/manager.go:158:Remove() [T] [6429780a-21] Queue Manager removed: QID: 5
2023/04/02 19:41:46 ...s/process/manager.go:170:Add() [T] Start 6429780a-23: Queue: repo-archive-channel (system)
2023/04/02 19:41:46 ...s/watcher/watcher.go:60:func1() [T] [6429780a-20] Watcher: Mailer Templates watching "C:\gitea\custom\templates\mail\issue"
2023/04/02 19:41:46 ...les/queue/manager.go:149:Add() [T] Queue Manager registered: repo-archive-channel (QID: 7)
2023/04/02 19:41:46 ...s/process/manager.go:170:Add() [T] Start 6429780a-24: Queue: repo-archive-level (system)
2023/04/02 19:41:46 ...les/queue/manager.go:149:Add() [T] Queue Manager registered: repo-archive-level (QID: 8)
2023/04/02 19:41:46 ...s/watcher/watcher.go:60:func1() [T] [6429780a-20] Watcher: Mailer Templates watching "C:\gitea\custom\templates\mail\issue\comment.tmpl"
2023/04/02 19:41:46 ...les/queue/manager.go:149:Add() [T] Queue Manager registered: repo-archive (QID: 9)
2023/04/02 19:41:46 ...ueue_disk_channel.go:188:Run() [D] [6429780a-23] PersistableChannelUniqueQueue: repo-archive Starting
2023/04/02 19:41:46 .../queue/workerpool.go:283:commonRegisterWorkers() [T] [6429780a-23] WorkerPool: 7 (for repo-archive-channel) adding 0 workers with group id: 1
2023/04/02 19:41:46 ...ueue_disk_channel.go:234:Run() [D] [6429780a-23] PersistableChannelUniqueQueue: repo-archive Skipping running the empty level queue
2023/04/02 19:41:46 .../queue/workerpool.go:283:commonRegisterWorkers() [T] [6429780a-23] WorkerPool: 8 (for repo-archive-level) adding 1 workers with group id: 1
2023/04/02 19:41:46 ...s/watcher/watcher.go:60:func1() [T] [6429780a-20] Watcher: Mailer Templates watching "C:\gitea\custom\templates\mail\issue\default.tmpl"
My templates are registered without any problems as I see.
From logs after commenting PR:
2023/04/02 19:44:34 ...ces/mailer/mailer.go:101:NewMessageFrom() [T] [642978b2] NewMessageFrom (body):
<head>
2023/04/02 19:44:35 ...ces/mailer/mailer.go:376:func1() [T] [6429780a-18] New e-mail sending request [denisovve@nornik.ru]: Subject: Re: [DenisovVE/test] Test1 (#3), issue comments
And logs itself:
gitea.log
My custom templates' bodies are only Comment and Default. I've changed .tmpl extensions to .txt to have possibility to add templates here.
comment.txt
default.txt
In all cases I always get this:
It's just a minimal html, but previously I've tried with small changing built-in templates and using as my custom template too. No useful result. And there are no any errors in logs.
Gitea Version
1.19.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.24.1.windows.2
Operating System
Windows Server 2016 (v. 1607 build 14393.5648)
How are you running Gitea?
As Windows Service or just launching .exe itself. Result is the same.
Database
MSSQL
@dsvictory commented on GitHub (Apr 12, 2023):
Issue is closed because of the solving the problems in https://github.com/go-gitea/gitea/issues/24075.