Help with changing the subjects of notification emails

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.

Any help would be highly appreciated, thanks!

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?

If you put {{.Subject}} somewhere in body of mail template, does it output Test Subject or is it empty?

@jake It seems like I got nothing back. See the attached screenshot. I did restart the gitea container after modifying the template as well.

P.S:

  • The template I’m modifying is in /data/gitea/templates/mail/auth/register_notify.tmpl.
  • According to gitea help my CustomPath is /data/gitea