I am trying to modify the subject lines of emails sent out from my self-hosted gitea instance (v1.20.5 via docker-compose).
I am following this page in the docs: Mail templates | Gitea Documentation. I have ran gitea embedded extract --destination /data/gitea templates/mail/** and modified one of the downloaded templates and added this line at the very top:
Test Subject
---
<!DOCTYPE html>
<body>
...
</body>
And then I ran docker compose restart to restart the gitea server. But my changes to the subject line are disregarded and .FallbackSubject from the metadata context is used. I have tested and I have no issue modifying the email body, it’s just the email subject.
I’ve played around with it a bit more, read more pages from the gitea docs and the golang’s template engine. I really doubt I am doing anything wrong here, I’m more inclined to believe this is a bug with gitea, therefore I’ve opened an issue on github here:
I have posted my issue on all of the official channels and still have got not a single word in response. Could someone please let me know if this is acknowledged?
@jake
If I put {{.Subject}} somewhere in body of mail template. It output nothing. Seems this is a bug. I have tried 200 times and with many different way but still does not work. Please help.
That’s a bug. Seems like Gitea only applies this --- subject to issue related mail while others just use the default one. So our results are both reasonable now.