]> source.dussan.org Git - gitea.git/commitdiff
Display app name in the registration email title (#31562)
authorSunny Wan <94445569+SunnyWan59@users.noreply.github.com>
Thu, 11 Jul 2024 23:23:31 +0000 (19:23 -0400)
committerGitHub <noreply@github.com>
Thu, 11 Jul 2024 23:23:31 +0000 (23:23 +0000)
I changed the title of the registation email from "Welcome to Gitea" to
"Welcome to (appname)". I did this by substituting 'Gitea' in
register_notify to %s and formating the registration title in mail.go. I
changed this for all the languages I could, but I struggled to changed
the translation file for Farsi. I have attached the screenshots of
before and after and the related issue below.

Related issue:
https://github.com/go-gitea/gitea/issues/31108

Before change:
![Screenshot from 2024-07-04
22-32-17](https://github.com/go-gitea/gitea/assets/94445569/4178b51c-1acc-45f4-9750-dff41564a709)

After:
![Screenshot from 2024-07-04
22-32-01](https://github.com/go-gitea/gitea/assets/94445569/9cd7a58d-c0f5-4a3c-a66c-805c55411eaa)

---------

Signed-off-by: Sunny Wan <Sunnywan2020@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
options/locale/locale_en-US.ini
services/mailer/mail.go

index e0973fe8740dd2a1d9340803f6fa26b8fdd4fa2b..ef9e946c0a9e2ac6ced8d7f98a3552f24659dc5e 100644 (file)
@@ -477,7 +477,7 @@ activate_email = Verify your email address
 activate_email.title = %s, please verify your email address
 activate_email.text = Please click the following link to verify your email address within <b>%s</b>:
 
-register_notify = Welcome to Gitea
+register_notify = Welcome to %s
 register_notify.title = %[1]s, welcome to %[2]s
 register_notify.text_1 = this is your registration confirmation email for %s!
 register_notify.text_2 = You can now login via username: %s.
index 11810a036d62d904608079cec046901cdcf317b9..1f5df6efe7ede384c494f3e8bf34f8923c395aad 100644 (file)
@@ -158,7 +158,7 @@ func SendRegisterNotifyMail(u *user_model.User) {
                return
        }
 
-       msg := NewMessage(u.EmailTo(), locale.TrString("mail.register_notify"), content.String())
+       msg := NewMessage(u.EmailTo(), locale.TrString("mail.register_notify", setting.AppName), content.String())
        msg.Info = fmt.Sprintf("UID: %d, registration notify", u.ID)
 
        SendAsync(msg)