mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 08:04:21 +00:00
[MAIL] Use correct function in mail footer
- Regression of #4635 - The authentication mails weren't being sent with links to the instance, because the the wrong variable was used in the mail footer. `$.AppUrl` should've been `AppUrl`. - Unit test added.
This commit is contained in:
parent
2285526e93
commit
685a903cd5
|
@ -10,6 +10,7 @@ import (
|
||||||
"code.gitea.io/gitea/models/unittest"
|
"code.gitea.io/gitea/models/unittest"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/optional"
|
"code.gitea.io/gitea/modules/optional"
|
||||||
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/translation"
|
"code.gitea.io/gitea/modules/translation"
|
||||||
"code.gitea.io/gitea/services/mailer"
|
"code.gitea.io/gitea/services/mailer"
|
||||||
user_service "code.gitea.io/gitea/services/user"
|
user_service "code.gitea.io/gitea/services/user"
|
||||||
|
@ -49,6 +50,7 @@ func TestPrimaryMailChange(t *testing.T) {
|
||||||
assert.Equal(t, user.EmailTo(firstEmail.Email), msgs[0].To)
|
assert.Equal(t, user.EmailTo(firstEmail.Email), msgs[0].To)
|
||||||
assert.EqualValues(t, translation.NewLocale("en-US").Tr("mail.primary_mail_change.subject"), msgs[0].Subject)
|
assert.EqualValues(t, translation.NewLocale("en-US").Tr("mail.primary_mail_change.subject"), msgs[0].Subject)
|
||||||
assert.Contains(t, msgs[0].Body, secondEmail.Email)
|
assert.Contains(t, msgs[0].Body, secondEmail.Email)
|
||||||
|
assert.Contains(t, msgs[0].Body, setting.AppURL)
|
||||||
mailer.AssertTranslatedLocale(t, msgs[0].Body, "mail.primary_mail_change.text_1", "mail.primary_mail_change.text_2", "mail.primary_mail_change.text_3")
|
mailer.AssertTranslatedLocale(t, msgs[0].Body, "mail.primary_mail_change.text_1", "mail.primary_mail_change.text_2", "mail.primary_mail_change.text_3")
|
||||||
called = true
|
called = true
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<p><a target="_blank" rel="noopener noreferrer" href="{{$.AppUrl}}">{{AppName}}</a></p>
|
<p><a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
|
||||||
|
|
Loading…
Reference in a new issue